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. |
oleksandr-pavlyk
left a comment
There was a problem hiding this comment.
Thank you, @ndgrigorian ! LGTM
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
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?