Skip to content

Commit 32de395

Browse files
authored
Add complex number support to linalg.matrix_norm (#565)
1 parent 3debcf1 commit 32de395

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/API_specification/array_api/linalg.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def matrix_norm(x: array, /, *, keepdims: bool = False, ord: Optional[Union[int,
208208
Parameters
209209
----------
210210
x: array
211-
input array having shape ``(..., M, N)`` and whose innermost two dimensions form ``MxN`` matrices. Should have a real-valued floating-point data type.
211+
input array having shape ``(..., M, N)`` and whose innermost two dimensions form ``MxN`` matrices. Should have a floating-point data type.
212212
keepdims: bool
213213
If ``True``, the last two axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array (see :ref:`broadcasting`). Otherwise, if ``False``, the last two axes (dimensions) must not be included in the result. Default: ``False``.
214214
ord: Optional[Union[int, float, Literal[inf, -inf, 'fro', 'nuc']]]
@@ -251,7 +251,7 @@ def matrix_norm(x: array, /, *, keepdims: bool = False, ord: Optional[Union[int,
251251
Returns
252252
-------
253253
out: array
254-
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``. The returned array must have a real-valued floating-point data type determined by :ref:`type-promotion`.
254+
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 :ref:`type-promotion`. 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).
255255
"""
256256

257257
def matrix_power(x: array, n: int, /) -> array:

0 commit comments

Comments
 (0)