-
Notifications
You must be signed in to change notification settings - Fork 12
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
Support multiple skip axes in iter_indices and broadcast_shapes #155
Merged
asmeurer
merged 39 commits into
Quansight-Labs:master
from
asmeurer:iter_indices-multi-skip_axes
Feb 1, 2024
Merged
Support multiple skip axes in iter_indices and broadcast_shapes #155
asmeurer
merged 39 commits into
Quansight-Labs:master
from
asmeurer:iter_indices-multi-skip_axes
Feb 1, 2024
Conversation
This file contains 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
… of skip_axes This changes the way the strategy is generated to construct skip_axes and a result shape first, then generate shapes that match those skip axes and broadcast to the result shape. It doesn't attempt to directly use mutually_broadcastable_shapes. This is unfortunate, and it does require a little bit of filtering, but it is the only way that I could figure out how to generate the full range of possible examples. skip_axes_st is now always generated in conjunction with this strategy, as 1) generating the skip axes first and then the shapes doesn't seem to work, and 2) the two strategies are always used together anyway. This doesn't yet update all the tests that use this (nor are the functions themselves updated), but test_mutually_broadcastable_shapes_with_skip_axes() passes.
…th skip_axes This is impossible to do in general if we allow both negative and nonnegative skip_axes, and it's also too complex to check the result shape skip axes to make sure they are consistent. Unfortunately, this is a backwards compatibility break, but hopefully no one is actually using this function yet.
This also changes the definition of the internal associated_axis() function.
The testing strategy is changed a little bit. We just test against the broadcasted arrays with the skip axes removed, since the number of skip axes is not necessarily uniform across the shapes anymore.
Only generate slices for completely skipped shapes once.
It is (hopefully) actually correct now with the new definition for skip_axes.
asmeurer
added a commit
to asmeurer/array-api-tests
that referenced
this pull request
Feb 3, 2024
This requires Quansight-Labs/ndindex#155 which is not yet released.
cr313
added a commit
to cr313/test-array-api
that referenced
this pull request
Apr 19, 2024
This requires Quansight-Labs/ndindex#155 which is not yet released.
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.
The old syntax is still allowed but you can also specify a separate set of skip_axes for each shape.