Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings


View source on GitHub

Create a random variable for BatchReshape.

    *args, **kwargs

See BatchReshape for more details.



Original Docstring for Distribution

Construct BatchReshape distribution.


  • distribution: The base distribution instance to reshape. Typically an instance of Distribution.
  • batch_shape: Positive int-like vector-shaped Tensor representing the new shape of the batch dimensions. Up to one dimension may contain -1, meaning the remainder of the batch size.
  • validate_args: Python bool, default False. When True distribution parameters are checked for validity despite possibly degrading runtime performance. When False invalid inputs may silently render incorrect outputs.
  • allow_nan_stats: Python bool, default True. When True, statistics (e.g., mean, mode, variance) use the value NaN to indicate the result is undefined. When False, an exception is raised if one or more of the statistic's batch members are undefined.
  • name: The name to give Ops created by the initializer. Default value: "BatchReshape" + distribution.name.


  • ValueError: if batch_shape is not a vector.
  • ValueError: if batch_shape has non-positive elements.
  • ValueError: if batch_shape size is not the same as a distribution.batch_shape size.