We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 398fdf1 commit 4d591d0Copy full SHA for 4d591d0
array_api_compat/common/_aliases.py
@@ -301,6 +301,15 @@ def _isscalar(a):
301
302
# but an answer of 0 might be preferred. See
303
# https://github.com/numpy/numpy/issues/24976 for more discussion on this issue.
304
+
305
306
+ # At least handle the case of Python integers correctly (see
307
+ # https://github.com/numpy/numpy/pull/26892).
308
+ if type(min) is int and min <= xp.iinfo(x.dtype).min:
309
+ min = None
310
+ if type(max) is int and max >= xp.iinfo(x.dtype).max:
311
+ max = None
312
313
if out is None:
314
out = wrapped_xp.asarray(xp.broadcast_to(x, result_shape), copy=True)
315
if min is not None:
0 commit comments