-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
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
Failing np.clip()
on float32
#339
Comments
ev-br
added a commit
to ev-br/array-api-tests
that referenced
this issue
Mar 23, 2025
Testing `clip` converts array elements to builtin types and uses exact equaity. Converting `out` from float32 to 64-bit builtin float incurs floating-point errors, and further exact equality testing fails. So use `math.isclose` instead. closes data-apisgh-339
managed to catch it on numpy 2.2. A fix in gh-355 |
Reopening: as discussed in gh-355, that fix may fix a different issue. So let's keep this open until we can repro and fix this specific issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: