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

(Array API support): Add __array_namespace_info__ and device #101

Merged
merged 11 commits into from
Jan 31, 2025

Conversation

adityagoel4512
Copy link
Member

@adityagoel4512 adityagoel4512 commented Jan 24, 2025

Continues with #6.

ndonnx/_array.py Outdated Show resolved Hide resolved
ndonnx/_info.py Outdated Show resolved Hide resolved
ndonnx/_info.py Outdated
Comment on lines 63 to 65
# We don't support complex numbers yet due to immaturity in the ONNX ecoystem, so "complex floating" is meaningless.
# The Array API standard requires this key to be present so we set it to None.
"complex floating": None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning something wrong is still not compliant with the standard, but it might lead to issues that are harder to debug than what one would get if the key were just missing. I think we should rather not return "complex floating" as a key.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do agree however the tests as they stand explicitly assert all the keys are present. See data-apis/array-api-tests#337.

ndonnx/_data_types/aliases.py Show resolved Hide resolved
Copy link
Collaborator

@cbourjau cbourjau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Looks good! I just have a few more minor suggestions.

ndonnx/_array.py Outdated Show resolved Hide resolved
ndonnx/_info.py Outdated
ndx.uint64,
]

def capabilities(self) -> dict:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def capabilities(self) -> dict:
def capabilities(self) -> dict[str, bool]:

ndonnx/_info.py Outdated Show resolved Hide resolved
ndonnx/_info.py Outdated Show resolved Hide resolved
.gitmodules Outdated Show resolved Hide resolved
ndonnx/_array.py Show resolved Hide resolved
@adityagoel4512 adityagoel4512 merged commit 4d70e5a into main Jan 31, 2025
19 checks passed
@adityagoel4512 adityagoel4512 deleted the add-namespace-info branch January 31, 2025 15:30
adityagoel4512 added a commit that referenced this pull request Jan 31, 2025
adityagoel4512 added a commit that referenced this pull request Jan 31, 2025
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