tensorflow_probability/python/bijectors/masked_autoregressive.py
def _gen_mask(num_blocks,
              n_in,
              n_out,
              mask_type=MASK_EXCLUSIVE,
              dtype=tf.float32):
  """Generate the mask for building an autoregressive dense layer."""
  # TODO(b/67594795): Better support of dynamic shape.
  mask = np.zeros([n_out, n_in], dtype=dtype.as_numpy_dtype())
  slices = _gen_slices(num_blocks, n_in, n_out, mask_type=mask_type)
  for [row_slice, col_slice] in slices:
    mask[row_slice, col_slice] = 1
  return mask
def _gen_mask(num_blocks,
              n_in,
              n_out,
              mask_type=MASK_EXCLUSIVE,
              dtype=tf.float32):
  # TODO(b/67594795): Better support of dynamic shape.
  mask = np.zeros([n_out, n_in], dtype=dtype.as_numpy_dtype())
  slices = _gen_slices(num_blocks, n_in, n_out, mask_type=mask_type)
  for [row_slice, col_slice] in slices:
    mask[row_slice, col_slice] = 1
  return mask
def _gen_mask ( num_blocks , n_in , n_out , mask_type = MASK_EXCLUSIVE , dtype = tf . float32 ) : # TODO(b/67594795): Better support of dynamic shape. mask = np . zeros ( [ n_out , n_in ] , dtype = dtype . as_numpy_dtype ( ) ) slices = _gen_slices ( num_blocks , n_in , n_out , mask_type = mask_type ) for [ row_slice , col_slice ] in slices : mask [ row_slice , col_slice ] = 1 return mask
Generate the mask for building an autoregressive dense layer.
Generate the mask for building an autoregressive dense layer .