We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clip
clip currently fails for out-of-bounds Python integers due to Numpy 2.0 changes:
In [21]: dpt.clip(dpt.asarray([0, 255], dtype=dpt.uint8), 0, 4550) --------------------------------------------------------------------------- OverflowError Traceback (most recent call last) Cell In[21], line 1 ----> 1 dpt.clip(dpt.asarray([0, 255], dtype=dpt.uint8), 0, 4550) File ~/repos/dpctl/dpctl/tensor/_clip.py:634, in clip(x, min, max, out, order) 632 a_max = max 633 else: --> 634 a_max = dpt.asarray(max, dtype=max_dtype, sycl_queue=exec_q) 636 if order == "A": 637 order = ( 638 "F" 639 if all( (...) 647 else "C" 648 ) File ~/repos/dpctl/dpctl/tensor/_ctors.py:649, in asarray(obj, dtype, device, copy, usm_type, sycl_queue, order) 644 raise ValueError( 645 f"Converting {type(obj)} to usm_ndarray requires a copy" 646 ) 647 # obj is a scalar, create 0d array 648 return _asarray_from_numpy_ndarray( --> 649 np.asarray(obj, dtype=dtype), 650 dtype=dtype, 651 usm_type=usm_type, 652 sycl_queue=sycl_queue, 653 order="C", 654 ) OverflowError: Python integer 4550 out of bounds for uint8
Numpy has been doing the same and has changed this in numpy/numpy#26892
dpctl should implement a similar work-around
The text was updated successfully, but these errors were encountered:
Add test based on code from gh-1744
635dc84
Add test to verify that Python scalars used for min/max which are out of bound for array integral data type get handled as None (no bounds).
c5e6acb
Successfully merging a pull request may close this issue.
clip
currently fails for out-of-bounds Python integers due to Numpy 2.0 changes:Numpy has been doing the same and has changed this in numpy/numpy#26892
dpctl should implement a similar work-around
The text was updated successfully, but these errors were encountered: