code: def _gen_slices(num_blocks, n_in, n_out, mask_type=MASK_EXCLUSIVE):
      """Generate the slices for building an autoregressive mask."""
      # TODO(b/67594795): Better support of dynamic shape.
      slices = []
      col = 0
      d_in = n_in // num_blocks
      d_out = n_out // num_blocks
      row = d_out if mask_type == MASK_EXCLUSIVE else 0
      for _ in range(num_blocks):
          row_slice = slice(row, None)
          col_slice = slice(col, col + d_in)
          slices.append([row_slice, col_slice])
          col += d_in
          row += d_out
      return slices
  
imports: import numpy
  import six
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.bijectors import chain
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.bijectors import shift
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import tf_keras
  from tensorflow_probability.python.math.numeric import clip_by_value_preserve_gradient
  from tensorflow.python.util import deprecation
label_desc: Use image node_id 1 for calling a global function with example usage: _gen_slices(num_blocks, n_in, n_out, mask_type) and returns: slices