Skip to content

Commit 15685e8

Browse files
Fix rtol/atol conversion getting real part of complex to match NumPy
1 parent 8691551 commit 15685e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dpnp/dpnp_iface_logic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -900,12 +900,12 @@ def isclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False):
900900
a = dpnp.astype(a, dt, casting="same_kind", copy=False)
901901
b = dpnp.astype(b, dt, casting="same_kind", copy=False)
902902

903-
# Convert complex rtol/atol to real values
903+
# Convert complex rtol/atol to to their real parts
904904
# to avoid pybind11 cast errors and match NumPy behavior
905905
if isinstance(rtol, complex):
906-
rtol = abs(rtol)
906+
rtol = rtol.real
907907
if isinstance(atol, complex):
908-
atol = abs(atol)
908+
atol = atol.real
909909

910910
# pylint: disable=W0707
911911
try:

0 commit comments

Comments
 (0)