svdvals¶
- svdvals(x: array, /) array ¶
Returns the singular values of a matrix (or a stack of matrices)
x
.When
x
is a stack of matrices, the function must compute the singular values for each matrix in the stack.- Parameters:
x (array) – input array having shape
(..., M, N)
and whose innermost two dimensions form matrices on which to perform singular value decomposition. Should have a floating-point data type.- Returns:
out (array) – an array with shape
(..., K)
that contains the vector(s) of singular values of lengthK
, whereK = min(M, N)
. For each vector, the singular values must be sorted in descending order by magnitude, such thats[..., 0]
is the largest value,s[..., 1]
is the second largest value, et cetera. The firstx.ndim-2
dimensions must have the same shape as those of the inputx
. The returned array must have a real-valued floating-point data type having the same precision asx
(e.g., ifx
iscomplex64
, the returned array must have afloat32
data type).
Notes
Changed in version 2022.12: Added complex data type support.