svdvals

Contents

svdvals#

class saiunit.linalg.svdvals(x, **kwargs)#

Compute the singular values of a matrix.

SaiUnit implementation of numpy.linalg.svdvals().

Parameters:

x (saiunit.Quantity | Array | ndarray | bool | number | bool | int | float | complex) – Input of shape (..., M, N).

Returns:

out – Singular values of shape (..., K) with K = min(M, N). Carries the same unit as x.

Return type:

Array | saiunit.Quantity

Examples

>>> import saiunit as u
>>> import jax.numpy as jnp
>>> x = jnp.array([[1., 2., 3.],
...                [4., 5., 6.]]) * u.meter
>>> u.linalg.svdvals(x)
ArrayImpl([9.50803089, 0.77286941], dtype=float32) * meter