Function lp_norm_dims
pub fn lp_norm_dims<const D: usize, I>(
x: Tensor<D>,
p: f64,
dims: &[I],
) -> Tensor<D>where
I: AsIndex,Expand description
Computes the general L(p) norm of a tensor along specified dimensions.
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).
Uses the specialized implementations for:
- 0.0
- 1.0
- 2.0
- 2 * N for integral N,
- f64::INFINITY,
- f64::NEG_INFINITY,
§Arguments
x- The input tensor.p- The exponent of the Lp norm.dims- The dimensions to compute the norm over. Negative dimensions are supported and count from the end.
§Returns
The L(p) norm of the input tensor.