matrix_norm#
- class saiunit.linalg.matrix_norm(x, *, keepdims=False, ord='fro', **kwargs)#
Compute the norm of a matrix or stack of matrices.
SaiUnit implementation of
numpy.linalg.matrix_norm().- Parameters:
- Returns:
out – Matrix norm with shape
x.shape[:-2](or(..., 1, 1)when keepdims isTrue). Carries the same unit as x.- Return type:
Union[Array, saiunit.Quantity]
Examples
>>> import saiunit as u >>> import jax.numpy as jnp >>> x = jnp.array([[1, 2, 3], ... [4, 5, 6], ... [7, 8, 9]]) * u.second >>> u.linalg.matrix_norm(x) 16.881943 * second