Skip to main content

l0_norm

Function l0_norm 

pub fn l0_norm<const D: usize, K>(
    x: Tensor<D, K>,
    dim: impl AsIndex,
) -> Tensor<D, K>
where K: Numeric,
Expand description

Computes the L0 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 L0 norm of the input tensor.