TensorPlay
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-08

ReshapeTransform

class tensorplay.distributions.ReshapeTransform(in_shape: Size, out_shape: Size, cache_size: int = 0)[source]

Unit Jacobian transform to reshape the rightmost part of a tensor.

Note that in_shape and out_shape must have the same number of elements, just as for tensorplay.Tensor.reshape().

Parameters:
  • in_shape (tensorplay.Size) – The input event shape.

  • out_shape (tensorplay.Size) – The output event shape.

  • cache_size (int) – Size of cache. If zero, no caching is done. If one, the latest single value is cached. Only 0 and 1 are supported. (Default 0.)

property inv: Transform

Returns the inverse Transform of this transform. This should satisfy t.inv.inv is t.

property sign: int

Returns the sign of the determinant of the Jacobian, if applicable. In general this only makes sense for bijective transforms.

On this page

Ask DeepWiki