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

Changes to integer indexing modes #1132

Merged
merged 4 commits into from
Mar 21, 2023
Merged

Changes to integer indexing modes #1132

merged 4 commits into from
Mar 21, 2023

Conversation

ndgrigorian
Copy link
Collaborator

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?

- 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
@github-actions
Copy link

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev0=py310h76be34b_2 ran successfully.
Passed: 46
Failed: 788
Skipped: 280

@coveralls
Copy link
Collaborator

coveralls commented Mar 20, 2023

Coverage Status

Coverage: 82.778% (+0.3%) from 82.516% when pulling a1078c7 on clipping-changes into 2273287 on master.

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev0=py310h76be34b_3 ran successfully.
Passed: 46
Failed: 788
Skipped: 280

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev0=py310h76be34b_4 ran successfully.
Passed: 46
Failed: 788
Skipped: 280

- For performance reasons, "wrap" now clips positive indices and wraps negative indices
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev0=py310h76be34b_5 ran successfully.
Passed: 46
Failed: 788
Skipped: 280

Copy link
Collaborator

@oleksandr-pavlyk oleksandr-pavlyk left a 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

Copy link
Collaborator

@vlad-perevezentsev vlad-perevezentsev left a comment

Choose a reason for hiding this comment

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

Many thanks @ndgrigorian !

@oleksandr-pavlyk oleksandr-pavlyk merged commit e4236a2 into master Mar 21, 2023
@github-actions
Copy link

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

@oleksandr-pavlyk oleksandr-pavlyk deleted the clipping-changes branch March 21, 2023 14:57
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev0=py310h76be34b_5 ran successfully.
Passed: 46
Failed: 788
Skipped: 280

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.

dpct.tensor.take does not disable negative indexing
4 participants