jax-js
    Preparing search index...
    • Compute the matrix or vector norm of an array.

      The behavior depends on the axis argument, matching jax.numpy.linalg.norm():

      • If axis is null and ord is null, computes the 2-norm of the flattened array (any rank is allowed).
      • If axis is null and ord is given, the input must be 1D (vector norm) or 2D (matrix norm).
      • If axis is an integer, computes a vector norm over that axis.
      • If axis is a pair of integers, computes a matrix norm over those axes.

      Parameters

      • x: ArrayLike

        Input array.

      • ord: {
            axis?: number | number[] | null;
            keepdims?: boolean;
            ord?: number | "f" | "fro" | "nuc" | null;
        } = {}

        Order of the norm (default: 2-norm for vectors, Frobenius norm for matrices).

      Returns Array

      The norm of x, reduced over the given axes.