Merged
Conversation
3 tasks
ev-br
requested changes
Mar 31, 2025
Member
ev-br
left a comment
There was a problem hiding this comment.
Looks like a great start!
Now that we're at it, could you add some more checks:
For a.device == idx.device:
a[idx, 1].device == a.devicea[idx, ...].device == a.device- other legal ways of indexing preserve the device
. - there's an error when indexing and indexed arrays are on different devices.
Contributor
Author
Good call, different devices were allowed. I've fixed but not 100% on wording of error message, happy to change. |
lucyleeow
commented
Apr 2, 2025
| np_key = key._array if isinstance(key, Array) else key | ||
| if isinstance(key, Array): | ||
| key = (key,) | ||
| np_key = key |
Contributor
Author
There was a problem hiding this comment.
The new naming key -> np_key, meant that I've had to add this line
Member
|
CI is green after the rerun, including just-added python 3.13 jobs. Thanks @lucyleeow , keep them coming! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #134
When indexing with tuple containing
Arrays, convert to numpy array (self._array) first. Not doing so results in e.g. "Can not convert array on the 'array_api_strict.Device('device1')' device to a Numpy array." errorParametrized indexing tests for all devices. Also added shape checks in test because while working on this PR, I created a bug that was not picked up by the test in the current format as the bug also affected the loop arrays.
cc @ev-br