Skip to content
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

Fix special case testing signbit on NaNs #253

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

honno
Copy link
Member

@honno honno commented Apr 12, 2024

Resolves #250

@oleksandr-pavlyk
Copy link
Contributor

@honno Thank you for the fix. I can confirm that the test_special_cases.py::test_unary now no longer fails in dpctl.

Now that file only fails here:

FAILED array_api_tests/test_special_cases.py::test_binary[copysign(x2_i < 0) -> NaN] - AssertionError: out=-0.0, but should be NaN [copysign()]
FAILED array_api_tests/test_special_cases.py::test_binary[copysign(x2_i is -0) -> NaN] - AssertionError: out=-0.0, but should be NaN [copysign()]
FAILED array_api_tests/test_special_cases.py::test_binary[copysign(x2_i is +0) -> NaN] - AssertionError: out=0.0, but should be NaN [copysign()]
FAILED array_api_tests/test_special_cases.py::test_binary[copysign(x2_i > 0) -> NaN] - AssertionError: out=0.0, but should be NaN [copysign()]
FAILED array_api_tests/test_special_cases.py::test_nan_propagation[cumulative_sum] - AssertionError: out.shape=(1,), but should be () [cumulative_sum()]

The copysign failures may be due to a similar issue, although I have not yet investigated in earnest.

@honno honno merged commit 6841d9c into data-apis:master Apr 12, 2024
4 checks passed
@honno honno deleted the fix-signbit-case branch April 15, 2024 16:35
@asmeurer
Copy link
Member

BTW, float('nan') always has positive sign (see data-apis/array-api#693 (comment)).

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.

Special case parser produces incorrect test case for signbit expected behavior for NaN
3 participants