Skip to content

Commit 89dd532

Browse files
committed
changing condition
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
1 parent 941bd07 commit 89dd532

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

src/array_api_extra/_lib/_testing.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -288,16 +288,12 @@ def xp_assert_close(
288288
rtol = 1e-7
289289

290290
if hasattr(atol, "ndim"):
291-
atol = as_numpy_array(atol, xp=xp)
292-
if atol.ndim > 0:
293-
msg = "atol must be a scalar or 0-D array"
294-
raise TypeError(msg)
291+
if atol.ndim == 0:
292+
atol = as_numpy_array(atol, xp=xp)
295293

296294
if hasattr(rtol, "ndim"):
297-
rtol = as_numpy_array(rtol, xp=xp)
298-
if rtol.ndim > 0:
299-
msg = "rtol must be a scalar or 0-D array"
300-
raise TypeError(msg)
295+
if rtol.ndim == 0:
296+
rtol = as_numpy_array(rtol, xp=xp)
301297

302298
actual_np = as_numpy_array(actual, xp=xp)
303299
desired_np = as_numpy_array(desired, xp=xp)

0 commit comments

Comments
 (0)