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

FIX Use array's device when promoting scalars #73

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

betatim
Copy link
Member

@betatim betatim commented Oct 21, 2024

When promoting a scalar in the context of an existing array, e.g. x ** 2 we should use the device of x for the array we create.

device1 = Device("device1")
x = asarray([1., 2, 3], device=device1)

y = x ** 2
Copy link
Member Author

Choose a reason for hiding this comment

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

Without the change this line would fail, but I felt like having the assert below is somehow useful for readers from the future, even though it isn't strictly necessary

@asmeurer asmeurer merged commit e775240 into data-apis:main Oct 21, 2024
21 checks passed
@asmeurer
Copy link
Member

@betatim should I make a release with these changes or are there more incoming?

@betatim
Copy link
Member Author

betatim commented Oct 22, 2024

I don't know, maybe lets wait a bit. I've been finding these via running the scikit-learn tests, so far they don't run to completion. But it needs a bit of digging to figure out what the bug is each time

@betatim betatim deleted the inherit-device-scalar-promotion branch October 22, 2024 07:08
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