class_docstr: Bijector which applies a list of bijectors to blocks of a `Tensor`.
  
  More specifically, given [F_0, F_1, ... F_n] which are scalar or vector
  bijectors this bijector creates a transformation which operates on the vector
  [x_0, ... x_n] with the transformation [F_0(x_0), F_1(x_1) ..., F_n(x_n)]
  where x_0, ..., x_n are blocks (partitions) of the vector.
  
  Example Use:
  
  ```python
  blockwise = tfb.Blockwise(
      bijectors=[tfb.Exp(), tfb.Sigmoid()], block_sizes=[2, 1]
    )
  y = blockwise.forward(x)
  
  # Equivalent to:
  x_0, x_1 = tf.split(x, [2, 1], axis=-1)
  y_0 = tfb.Exp().forward(x_0)
  y_1 = tfb.Sigmoid().forward(x_1)
  y = tf.concat([y_0, y_1], axis=-1)
  ```
  
  Keyword arguments can be passed to the inner bijectors by utilizing the inner
  bijector names, e.g.:
  
  ```python
  blockwise = tfb.Blockwise([Bijector1(name='b1'), Bijector2(name='b2')])
  y = blockwise.forward(x, b1={'arg': 1}, b2={'arg': 2})
  
  # Equivalent to:
  x_0, x_1 = tf.split(x, [1, 1], axis=-1)
  y_0 = Bijector1().forward(x_0, arg=1)
  y_1 = Bijector2().forward(x_1, arg=2)
  y = tf.concat([y_0, y_1], axis=-1)
  ```
docstr: Creates the bijector.
  
  Args:
    bijectors: A non-empty list of bijectors.
    block_sizes: A 1-D integer `Tensor` with each element signifying the
      length of the block of the input vector to pass to the corresponding
      bijector. The length of `block_sizes` must be be equal to the length of
      `bijectors`. If left as None, a vector of 1's is used.
    validate_args: Python `bool` indicating whether arguments should be
      checked for correctness.
    maybe_changes_size: Python `bool` indicating that this bijector might
      change the event size. If this is known to be false and set
      appropriately, then this will lead to improved static shape inference
      when the block sizes are not statically known.
    name: Python `str`, name given to ops managed by this object. Default:
      E.g., `Blockwise([Exp(), Softplus()]).name ==
      'blockwise_of_exp_and_softplus'`.
  
  Raises:
    NotImplementedError: If there is a bijector with `event_ndims` > 1.
    ValueError: If `bijectors` list is empty.
    ValueError: If size of `block_sizes` does not equal to the length of
      bijectors or is not a vector.
docstr_tok: ["Creates","the","bijector",".","Args",":","bijectors",":","A","non-empty","list","of","bijectors",".","block_sizes",":","A","1-D","integer","`","Tensor","`","with","each","element","signifying","the","length","of","the","block","of","the","input","vector","to","pass","to","the","corresponding","bijector",".","The","length","of","`","block_sizes","`","must","be","be","equal","to","the","length","of","`","bijectors","`",".","If","left","as","None",",","a","vector","of","1","'s","is","used",".","validate_args",":","Python","`","bool","`","indicating","whether","arguments","should","be","checked","for","correctness",".","maybe_changes_size",":","Python","`","bool","`","indicating","that","this","bijector","might","change","the","event","size",".","If","this","is","known","to","be","false","and","set","appropriately",",","then","this","will","lead","to","improved","static","shape","inference","when","the","block","sizes","are","not","statically","known",".","name",":","Python","`","str","`",",","name","given","to","ops","managed","by","this","object",".","Default",":","E.g.",",","`","Blockwise","(","[","Exp","(",")",",","Softplus","(",")","]",")",".name","==","'blockwise_of_exp_and_softplus","'","`",".","Raises",":","NotImplementedError",":","If","there","is","a","bijector","with","`","event_ndims","`",">","1",".","ValueError",":","If","`","bijectors","`","list","is","empty",".","ValueError",":","If","size","of","`","block_sizes","`","does","not","equal","to","the","length","of","bijectors","or","is","not","a","vector","."]
code: def __init__(
      self,
      bijectors,
      block_sizes=None,
      validate_args=False,
      maybe_changes_size=True,
      name=None,
  ):
      """Creates the bijector.
  
      Args:
        bijectors: A non-empty list of bijectors.
        block_sizes: A 1-D integer `Tensor` with each element signifying the
          length of the block of the input vector to pass to the corresponding
          bijector. The length of `block_sizes` must be be equal to the length of
          `bijectors`. If left as None, a vector of 1's is used.
        validate_args: Python `bool` indicating whether arguments should be
          checked for correctness.
        maybe_changes_size: Python `bool` indicating that this bijector might
          change the event size. If this is known to be false and set
          appropriately, then this will lead to improved static shape inference
          when the block sizes are not statically known.
        name: Python `str`, name given to ops managed by this object. Default:
          E.g., `Blockwise([Exp(), Softplus()]).name ==
          'blockwise_of_exp_and_softplus'`.
  
      Raises:
        NotImplementedError: If there is a bijector with `event_ndims` > 1.
        ValueError: If `bijectors` list is empty.
        ValueError: If size of `block_sizes` does not equal to the length of
          bijectors or is not a vector.
      """
      parameters = dict(locals())
      if not name:
          name = "blockwise_of_" + "_and_".join(
              [b.name for b in bijectors]
          )
          name = name.replace("/", "")
  
      with tf.name_scope(name) as name:
          for b in bijectors:
              if nest.is_nested(
                  b.forward_min_event_ndims
              ) or nest.is_nested(b.inverse_min_event_ndims):
                  raise ValueError("Bijectors must all be single-part.")
              elif isinstance(b.forward_min_event_ndims, int):
                  if (
                      b.forward_min_event_ndims
                      != b.inverse_min_event_ndims
                  ):
                      raise ValueError(
                          "Rank-changing bijectors are not supported."
                      )
                  elif b.forward_min_event_ndims > 1:
                      raise ValueError(
                          "Only scalar and vector event-shape "
                          "bijectors are supported at this time."
                      )
  
          b_joint = joint_map.JointMap(list(bijectors), name="jointmap")
  
          block_sizes = (
              np.ones(len(bijectors), dtype=np.int32)
              if block_sizes is None
              else _validate_block_sizes(
                  block_sizes, bijectors, validate_args
              )
          )
          b_split = split.Split(
              block_sizes, name="split", validate_args=validate_args
          )
  
          if maybe_changes_size:
              i_block_sizes = _validate_block_sizes(
                  ps.concat(
                      b_joint.forward_event_shape_tensor(
                          ps.split(block_sizes, len(bijectors))
                      ),
                      axis=0,
                  ),
                  bijectors,
                  validate_args,
              )
              maybe_changes_size = not tf.get_static_value(
                  ps.reduce_all(block_sizes == i_block_sizes)
              )
          b_concat = invert.Invert(
              (
                  split.Split(i_block_sizes, name="isplit")
                  if maybe_changes_size
                  else b_split
              ),
              name="concat",
          )
  
          self._maybe_changes_size = maybe_changes_size
          self._chain = chain.Chain(
              [b_concat, b_joint, b_split], validate_args=validate_args
          )
          super(_Blockwise, self).__init__(
              bijectors=self._chain.bijectors,
              validate_args=validate_args,
              validate_event_size=True,
              parameters=parameters,
              name=name,
          )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.bijectors import chain
  from tensorflow_probability.python.bijectors import composition
  from tensorflow_probability.python.bijectors import invert
  from tensorflow_probability.python.bijectors import joint_map
  from tensorflow_probability.python.bijectors import split
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import auto_composite_tensor
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow.python.util import nest
label_desc: Use image node_id 1 to create a new _Blockwise object from inherited base classes: composition with example: obj = _Blockwise(bijectors, block_sizes, validate_args, maybe_changes_size, name)