Function lp_norm

pub fn lp_norm<B, const D: usize>(
    x: Tensor<B, D>,
    p: f64,
    dim: usize,
) -> Tensor<B, D>
where B: Backend,
Expand description

Computes the general L(p) norm of a tensor along a specified dimension.

§Arguments

  • x - The input tensor.
  • p - The exponent of the Lp norm.
  • dim - The dimension to compute the norm over.

§Returns

The L(p) norm of the input tensor.