Skip to content

Commit 6ea8ae2

Browse files
committed
MAINT: inline the check for complex dtypes
Preferred as long as xp.isdtype is not universally available (looking at you pytorch)
1 parent fe3e05c commit 6ea8ae2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: array_api_tests/test_linalg.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -907,8 +907,8 @@ def true_trace(x_stack, offset=0):
907907

908908

909909
def _conj(x):
910-
"""Work around xp.conj rejecting floats."""
911-
if xp.isdtype(x.dtype, 'complex floating'):
910+
# XXX: replace with xp.dtype when all array libraries implement it
911+
if x.dtype in (xp.complex64, xp.complex128):
912912
return xp.conj(x)
913913
else:
914914
return x

0 commit comments

Comments
 (0)