Skip to main content

NDArray::norm

public static function norm(NDArray|array $a, int $order = 2): float;

Calculates different norms (e.g., L1 norm, L2 norm) of an array, providing various measures of its magnitude.

$order options​

  • 1 - L1-Norm
  • 2 - L2-Norm

Notes​

tip

GPU SUPPORTED​

This operation is supported by GPU (VRAM) and contains a custom CUDA kernel.