Join us at TensorFlow World, Oct 28-31. Use code TF20 for 20% off select passes. Register now


Create a random variable for BatchReshape.


Defined in python/edward2/

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" +


  • 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.