Skip to content

Monkey patch st.floats() to always disable subnormals #47

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

Merged
merged 1 commit into from
Dec 8, 2021

Conversation

honno
Copy link
Member

@honno honno commented Dec 8, 2021

Now subnormals are out-of-scope in data-apis/array-api#341, this PR disables them completely by monkey-patching the underlying st.floats() strategy used in xps.from_dtype() and xps.arrays(). This is a bit hacky, but requires no change in how we use strategies i.e. no passing allow_subnormal everytime or wrapping xps.arrays.

Tested with both NumPy and CuPy.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@honno
Copy link
Member Author

honno commented Dec 8, 2021

Merging as it's a small change that's nice to get in ASAP.

@honno honno merged commit 8b8ac96 into data-apis:master Dec 8, 2021
@honno honno deleted the disable-subnormals branch February 28, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant