matrix_norm — Python array API standard 2024.12 documentation (original) (raw)

matrix_norm(x: array, /, *, keepdims: bool = False, ord: int | float | ~typing.Literal[inf, -inf, 'fro', 'nuc'] | None = 'fro') → array

Computes the matrix norm of a matrix (or a stack of matrices) x.

Parameters:

Returns:

out (array) – an array containing the norms for each MxN matrix. If keepdims is False, the returned array must have a rank which is two less than the rank of x. If x has a real-valued data type, the returned array must have a real-valued floating-point data type determined by Type Promotion Rules. If x has a complex-valued data type, the returned array must have a real-valued floating-point data type whose precision matches the precision of x (e.g., if x is complex128, then the returned array must have a float64 data type).

Notes

Changed in version 2022.12: Added complex data type support.