class_docstr: Initializer which concats other intializers.
class_docstr_tok: ["Initializer","which","concats","other","intializers","."]
docstr: Returns a tensor object initialized as specified by the initializer.
  
  Args:
    shape: Shape of the tensor.
    dtype: Optional dtype of the tensor. If not provided will return tensor
     of `tf.float32`.
docstr_tok: ["Returns","a","tensor","object","initialized","as","specified","by","the","initializer",".","Args",":","shape",":","Shape","of","the","tensor",".","dtype",":","Optional","dtype","of","the","tensor",".","If","not","provided","will","return","tensor","of","`","tf.float32","`","."]
code: def __call__(self, shape, dtype=None):
      """Returns a tensor object initialized as specified by the initializer.
  
      Args:
        shape: Shape of the tensor.
        dtype: Optional dtype of the tensor. If not provided will return tensor
         of `tf.float32`.
      """
      dtype = tf.as_dtype(dtype or tf_keras.backend.floatx())
      if isinstance(shape, tf.TensorShape):
          shape_dtype = tf.int32
          shape_ = np.int32(shape)
      else:
          if not tf.is_tensor(shape):
              shape = tf.convert_to_tensor(
                  value=shape, dtype_hint=tf.int32, name="shape"
              )
          shape_dtype = shape.dtype.base_dtype
          shape_ = tf.get_static_value(shape, partial=True)
  
      sizes_ = tf.get_static_value(self.sizes)
      if sizes_ is not None:
          sizes_ = np.array(sizes_, shape_dtype.as_numpy_dtype)
  
      assertions = []
      message = "Rightmost dimension of shape must equal `sum(sizes)`."
      n = (
          shape[-1]
          if shape_ is None or shape_[-1] is None
          else shape_[-1]
      )
      if sizes_ is not None and not tf.is_tensor(n):
          if sum(sizes_) != n:
              raise ValueError(message)
      elif self.validate_args:
          assertions.append(
              tf.debugging.assert_equal(
                  shape[-1], tf.reduce_sum(self.sizes), message=message
              )
          )
  
      s = (
          shape[:-1]
          if shape_ is None or any(s is None for s in shape_[:-1])
          else shape_[:-1]
      )
      if sizes_ is not None and isinstance(s, (np.ndarray, np.generic)):
          return tf.concat(
              [
                  tf_keras.initializers.get(init)(
                      np.concatenate(
                          [
                              s,
                              np.array([e], shape_dtype.as_numpy_dtype),
                          ],
                          axis=-1,
                      ),
                      dtype,
                  )
                  for init, e in zip(self.initializers, sizes_.tolist())
              ],
              axis=-1,
          )
  
      sizes = tf.split(self.sizes, len(self.initializers))
      return tf.concat(
          [
              tf_keras.initializers.get(init)(
                  tf.concat([s, e], axis=-1), dtype
              )
              for init, e in zip(self.initializers, sizes)
          ],
          axis=-1,
      )
  
file_path: probability/tensorflow_probability/python/layers/initializers.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import tf_keras
label_desc: Use image node_id 5 for calling the BlockwiseInitializer obj's underlying member method code with example usage: obj.__call__(shape, dtype) and returns: tf, tf