Skip to main content

vector_norm_dims

Function vector_norm_dims 

pub fn vector_norm_dims<const D: usize, I>(
    x: Tensor<D>,
    norm: impl Into<Norm>,
    dims: &[I],
) -> Tensor<D>
where I: AsIndex,
Expand description

Computes the vector norm of a tensor along specified dimensions.

Generic dispatch wrapper over specialized / optimized norms.

If dims is empty, no dimensions are reduced, matching ONNX noop_with_empty_axes=true semantics (the norm transformation is applied elementwise without collapsing axes).

See:

§Arguments

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

§Returns

The vector norm of the input tensor.