Skip to content

Avoid using .size in test_eye #240

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
Mar 7, 2024
Merged

Conversation

asmeurer
Copy link
Member

@asmeurer asmeurer commented Mar 7, 2024

.size doesn't work in pytorch and cannot be worked around even in the compat library.

.size doesn't work in pytorch and cannot be worked around even in the compat
library.
@asmeurer
Copy link
Member Author

asmeurer commented Mar 7, 2024

This is blocking some compat library work so I'm going to just merge this. It's a one-line fix and I manually confirmed it fixes the array_api_compat.torch test failure.

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

This works I believe. In other places we use size = math.prod(x.shape) for this same reason.

@rgommers rgommers merged commit 8fb5e01 into data-apis:master Mar 7, 2024
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