We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a65b5d commit 941bd07Copy full SHA for 941bd07
1 file changed
src/array_api_extra/_lib/_testing.py
@@ -287,13 +287,13 @@ def xp_assert_close(
287
else:
288
rtol = 1e-7
289
290
- if not isinstance(atol, float):
+ 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)
295
296
- if not isinstance(rtol, float):
+ 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"
0 commit comments