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 fa24021 commit 94be1c8Copy full SHA for 94be1c8
array_api_compat/common/_aliases.py
@@ -376,13 +376,13 @@ def _isscalar(a):
376
if min is not None:
377
a = wrapped_xp.asarray(min, dtype=x.dtype, device=dev)
378
a = xp.broadcast_to(a, result_shape)
379
- ia = (out < a) | xp.isnan(a)
+ ia = ~(out >= a) # Propagate NaNs
380
out[ia] = a[ia]
381
382
if max is not None:
383
b = wrapped_xp.asarray(max, dtype=x.dtype, device=dev)
384
b = xp.broadcast_to(b, result_shape)
385
- ib = (out > b) | xp.isnan(b)
+ ib = ~(out <= b) # Propagate NaNs
386
out[ib] = b[ib]
387
388
# Return a scalar for 0-D
0 commit comments