Skip to content

Commit 941bd07

Browse files
committed
checking for ndim attribute instead
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
1 parent 4a65b5d commit 941bd07

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/array_api_extra/_lib/_testing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,13 @@ def xp_assert_close(
287287
else:
288288
rtol = 1e-7
289289

290-
if not isinstance(atol, float):
290+
if hasattr(atol, "ndim"):
291291
atol = as_numpy_array(atol, xp=xp)
292292
if atol.ndim > 0:
293293
msg = "atol must be a scalar or 0-D array"
294294
raise TypeError(msg)
295295

296-
if not isinstance(rtol, float):
296+
if hasattr(rtol, "ndim"):
297297
rtol = as_numpy_array(rtol, xp=xp)
298298
if rtol.ndim > 0:
299299
msg = "rtol must be a scalar or 0-D array"

0 commit comments

Comments
 (0)