latest (dev)
Copy
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_shapeandout_shapemust have the same number of elements, just as fortensorplay.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
Transformof this transform. This should satisfyt.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.
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

