TensorPlay
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-08

StackTransform

class tensorplay.distributions.StackTransform(tseq: Sequence[Transform], dim: int = 0, cache_size: int = 0)[source]

Transform functor that applies a sequence of transforms tseq component-wise to each submatrix at dim in a way compatible with tensorplay.stack().

Example:

x = tensorplay.stack([tensorplay.range(1, 10), tensorplay.range(1, 10)], dim=1)
t = StackTransform([ExpTransform(), identity_transform], dim=1)
y = t(x)
forward_shape(shape)

Infers the shape of the forward computation, given the input shape. Defaults to preserving shape.

property inv: Transform

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

inverse_shape(shape)

Infers the shapes of the inverse computation, given the output shape. Defaults to preserving shape.

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