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

iinfo and finfo do not accept Arrays as input #116

Open
mdhaber opened this issue Dec 30, 2024 · 1 comment
Open

iinfo and finfo do not accept Arrays as input #116

mdhaber opened this issue Dec 30, 2024 · 1 comment

Comments

@mdhaber
Copy link

mdhaber commented Dec 30, 2024

According to the standard, iinfo and finfo are supposed to accept an array (not just a type) for the first argument, but:

import array_api_strict as xp
xp.finfo(xp.asarray([1.]))  # ValueError: data type <class 'numpy.object_'> not inexact
xp.iinfo(xp.asarray([1]))  # ValueError: Invalid integer data type 'O'.
xp.__version__  # 2.2

Crossref numpy/numpy#22977, specifically argument against this type of overloading numpy/numpy#22977 (comment).

@ev-br
Copy link
Contributor

ev-br commented Jan 15, 2025

Would be easy to tweak array-api-strict to follow the spec; however maybe tighten the spec instead?

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

2 participants