Skip to content

Commit a1304fe

Browse files
authored
Add complex number support to linalg.svdvals (#562)
1 parent e9a1683 commit a1304fe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: spec/API_specification/array_api/linalg.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -460,15 +460,17 @@ def svdvals(x: array, /) -> array:
460460
"""
461461
Returns the singular values of a matrix (or a stack of matrices) ``x``.
462462
463+
When ``x`` is a stack of matrices, the function must compute the singular values for each matrix in the stack.
464+
463465
Parameters
464466
----------
465467
x: array
466-
input array having shape ``(..., M, N)`` and whose innermost two dimensions form matrices on which to perform singular value decomposition. Should have a real-valued floating-point data type.
468+
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.
467469
468470
Returns
469471
-------
470472
out: array
471-
an array with shape ``(..., K)`` that contains the vector(s) of singular values of length ``K``, where ``K = min(M, N)``. For each vector, the singular values must be sorted in descending order by magnitude, such that ``s[..., 0]`` is the largest value, ``s[..., 1]`` is the second largest value, et cetera. The first ``x.ndim-2`` dimensions must have the same shape as those of the input ``x``. The returned array must have the same real-valued floating-point data type as ``x``.
473+
an array with shape ``(..., K)`` that contains the vector(s) of singular values of length ``K``, where ``K = min(M, N)``. For each vector, the singular values must be sorted in descending order by magnitude, such that ``s[..., 0]`` is the largest value, ``s[..., 1]`` is the second largest value, et cetera. The first ``x.ndim-2`` dimensions must have the same shape as those of the input ``x``. The returned array must have a real-valued floating-point data type having the same precision as ``x`` (e.g., if ``x`` is ``complex64``, the returned array must have a ``float32`` data type).
472474
"""
473475

474476
def tensordot(x1: array, x2: array, /, *, axes: Union[int, Tuple[Sequence[int], Sequence[int]]] = 2) -> array:

0 commit comments

Comments
 (0)