jactorch.functional.linalg
Linear algebra functions.
Functions
Functions
-
normalize(tensor, p=2, dim=-1, eps=1e-8)[source]
Normalize the input along a specific dimension.
\[tensor = \frac{tensor}{\max(\lVert tensor \rVert_p, \epsilon)}\]
- Parameters:
tensor (Tensor) – input.
p (int) – the exponent value in the norm formulation. Default: 2.
dim (int) – the dimension of the normalization.
eps (float) – eps for numerical stability.
- Returns:
normalized input.
- Return type:
Tensor