Skip to main content

l0_norm_dims

Function l0_norm_dims 

pub fn l0_norm_dims<const D: usize, K, I>(
    x: Tensor<D, K>,
    dims: &[I],
) -> Tensor<D, K>
where I: AsIndex, K: Numeric,
Expand description

Computes the L0 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).

§Arguments

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

§Returns

The L0 norm of the input tensor.