TensorPlay
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-08

AffineTransform

class tensorplay.distributions.AffineTransform(loc: Tensor | float, scale: Tensor | float, event_dim: int = 0, cache_size: int = 0)[source]

Transform via the pointwise affine mapping y=loc+scale×xy = \text{loc} + \text{scale} \times x.

Parameters:
  • loc (Tensor or float) – Location parameter.

  • scale (Tensor or float) – Scale parameter.

  • event_dim (int) – Optional size of event_shape. This should be zero for univariate random variables, 1 for distributions over vectors, 2 for distributions over matrices, etc.

property inv: Transform

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

On this page

Ask DeepWiki