Skip to main content

l2_norm

Function l2_norm 

pub fn l2_norm<const D: usize>(x: Tensor<D>, dim: impl AsIndex) -> Tensor<D>
Expand description

Computes the L2 norm of a tensor along a specified dimension.

§Arguments

  • x - The input tensor.
  • dim - The dimension to compute the norm over. Negative dimensions are supported and count from the end.

§Returns

The L2 norm of the input tensor.