Skip to content

Fix undefined dtypes being passed in kwargs of stat tests #158

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
Jan 10, 2023

Conversation

honno
Copy link
Member

@honno honno commented Jan 10, 2023

@asmeurer noted undefined dtypes could be passed as the dtype kwarg for test_prod, i.e. for pytorch (using data-apis/array-api-compat#14).

$ ARRAY_API_TESTS_MODULE=array_api_compat.torch pytest --disable-warnings array_api_tests/test_statistical_functions.py::test_prod
...
TypeError: prod() received an invalid combination of arguments - got (Tensor, dtype=_UndefinedStub), but expected one of:
Falsifying example: test_prod(
    x=tensor(0, dtype=torch.uint8), data=data(...),
)
Draw 1 (kw): {'dtype': <undefined stub for 'uint32'>

This PR filters the pool of available dtypes so this doesn't happen for either test_prod or test_sum. Note these tests will still fail for pytorch as it doesn't follow the prod/sum-specific type promotion rules of the Array API.

@honno honno requested a review from asmeurer January 10, 2023 11:37
@asmeurer
Copy link
Member

This fixes the issue I was having. Thanks.

@asmeurer asmeurer merged commit e3a0722 into data-apis:master Jan 10, 2023
@honno honno deleted the filter-undefined-kw-dtypes 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.

2 participants