Skip to content

Commit

Permalink
MAINT: inline the check for complex dtypes
Browse files Browse the repository at this point in the history
Preferred as long as xp.isdtype is not universally available
(looking at you pytorch)
  • Loading branch information
ev-br committed Nov 20, 2024
1 parent fe3e05c commit 6ea8ae2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions array_api_tests/test_linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,8 +907,8 @@ def true_trace(x_stack, offset=0):


def _conj(x):
"""Work around xp.conj rejecting floats."""
if xp.isdtype(x.dtype, 'complex floating'):
# XXX: replace with xp.dtype when all array libraries implement it
if x.dtype in (xp.complex64, xp.complex128):
return xp.conj(x)
else:
return x
Expand Down

0 comments on commit 6ea8ae2

Please sign in to comment.