-
Notifications
You must be signed in to change notification settings - Fork 30
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
Changes to integer indexing modes #1132
Conversation
- Re-implements ClipIndex to clip indices from 0 <= i < n - Adds FancyIndex class, which clips indices to -n <= i < n then wraps negative indices (old ClipIndex) - Integer indexing functions have "fancy" mode (old "clip") and "clip" mode (uses new behavior) - dpctl.tensor.take and dpctl.tensor.put now default to "fancy" mode rather than "clip" mode - Indexing mode tests now test for new clip behavior
View rendered docs @ https://intelpython.github.io/dpctl/pulls/1132/index.html |
Array API standard conformance tests for dpctl=0.14.3dev0=py310h76be34b_2 ran successfully. |
Array API standard conformance tests for dpctl=0.14.3dev0=py310h76be34b_3 ran successfully. |
Array API standard conformance tests for dpctl=0.14.3dev0=py310h76be34b_4 ran successfully. |
- For performance reasons, "wrap" now clips positive indices and wraps negative indices
Array API standard conformance tests for dpctl=0.14.3dev0=py310h76be34b_5 ran successfully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @ndgrigorian ! LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks @ndgrigorian !
Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞 |
Array API standard conformance tests for dpctl=0.14.3dev0=py310h76be34b_5 ran successfully. |
Resolves #1129
Re-implements ClipIndex to clip indices from 0 <= i < n
Adds FancyIndex class, which clips indices to -n <= i < n then wraps negative indices (old ClipIndex)
Integer indexing functions have "fancy" mode (old "clip") and "clip" mode (uses new behavior)
dpctl.tensor.take and dpctl.tensor.put now default to "fancy" mode rather than "clip" mode
Indexing mode tests now test for new clip behavior
Have you provided a meaningful PR description?
Have you added a test, reproducer or referred to an issue with a reproducer?
Have you tested your changes locally for CPU and GPU devices?
Have you made sure that new changes do not introduce compiler warnings?
If this PR is a work in progress, are you filing the PR as a draft?