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
np.clip()
e.g. https://github.com/data-apis/array-api-compat/actions/runs/13060007276/job/36440413878?pr=247
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_clip - AssertionError: out[()]=-16777216.0 but should be -16777217.0 [clip()] x[()]=0.0, min[()]=None, max[()]=-16777217.0 assert -16777216.0 == np.float64(-16777217.0) Falsifying example: test_clip( x=array(0., dtype=float32), data=data(...), ) Draw 1 (min.shape, max.shape): ((), ()) Draw 2 (min): None Draw 3 (max): np.float64(-16777217.0) Draw 4 (kwargs): {'max': np.float64(-16777217.0)}
The problem is somehow caused by the fact that np.float32(-16777217.0) == -16777216.0. However I can't reproduce the error on numpy 2.0.2:
np.float32(-16777217.0) == -16777216.0
>>> np.clip(np.asarray(0, dtype=np.float32), None, -16777217.0) np.float32(-16777216.0) # Correctly follows rule about binops mixing pure python and arrays >>> np.clip(np.asarray(0, dtype=np.float32), None, np.float32(-16777217.0)) np.float32(-16777216.0) >>> np.clip(np.asarray(0, dtype=np.float32), None, np.float64(-16777217.0)) np.float64(-16777217.0)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
e.g. https://github.com/data-apis/array-api-compat/actions/runs/13060007276/job/36440413878?pr=247
The problem is somehow caused by the fact that
np.float32(-16777217.0) == -16777216.0
.However I can't reproduce the error on numpy 2.0.2:
The text was updated successfully, but these errors were encountered: