# AffineTransform Source: https://www.tensorplay.cn/docs/generated/tensorplay.distributions.AffineTransform.html ```python class tensorplay.distributions.AffineTransform(loc: Tensor | float, scale: Tensor | float, event_dim: int = 0, cache_size: int = 0) ``` Transform via the pointwise affine mapping $y = \text{loc} + \text{scale} \times x$. Parameters: - loc ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor) or [float](https://docs.python.org/3/builtins/functions.html#float)) – Location parameter. - scale ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor) or [float](https://docs.python.org/3/builtins/functions.html#float)) – Scale parameter. - event_dim ([int](https://docs.python.org/3/builtins/functions.html#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. ```python property inv: Transform ``` Returns the inverse [Transform](/docs/generated/tensorplay.distributions.Transform.html#tensorplay.distributions.Transform) of this transform. This should satisfy t.inv.inv is t.