Skip to content

Changes to integer indexing modes - #1132

Merged
oleksandr-pavlyk merged 4 commits into
masterfrom
clipping-changes
Mar 21, 2023
Merged

oleksandr-pavlyk merged 4 commits into
masterfrom
clipping-changes

Conversation

@ndgrigorian

Copy link
Copy Markdown
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
Copy Markdown

@github-actions

Copy link
Copy Markdown

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

@coveralls

coveralls commented Mar 20, 2023 •

Copy link
Copy Markdown
Collaborator

Coverage Status

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

@github-actions

Copy link
Copy Markdown

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

Comment thread dpctl/tensor/_indexing_functions.py Resolved
@github-actions

Copy link
Copy Markdown

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
Copy Markdown

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

@oleksandr-pavlyk oleksandr-pavlyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you, @ndgrigorian ! LGTM

@vlad-perevezentsev vlad-perevezentsev left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown

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
Copy Markdown

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