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

Allow changing the default dtypes #38

Open
asmeurer opened this issue Apr 25, 2024 · 1 comment
Open

Allow changing the default dtypes #38

asmeurer opened this issue Apr 25, 2024 · 1 comment

Comments

@asmeurer
Copy link
Member

See https://data-apis.org/array-api/latest/API_specification/data_types.html#default-data-types and https://data-apis.org/array-api/latest/API_specification/generated/array_api.info.default_dtypes.html#array_api.info.default_dtypes.

We should add flags to the set_array_api_strict_flags to configure these away from the NumPy defaults.

One concern here is that some instances of moving from float64 to float32, we might have to just downcast the result from NumPy, meaning the computation will still happen in float64, producing a result that could be different from a library that actually does everything in float32. This should likely be worked around wherever possible by downcasting the input before computing rather than the output.

@asmeurer
Copy link
Member Author

asmeurer commented Apr 25, 2024

We could also add behavior to emulate missing dtypes. This would require rewriting the existing code little bit, so I'm only really included to implement this if people ask for it. It would help map to libraries like pytorch, but at the same time, people will just test against those libraries so it isn't strictly necessary for array-api-strict to be the provider of this behavior.

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

No branches or pull requests

1 participant