Fix dpnp.einsum memory-layout - #3058
Open
abagusetty wants to merge 3 commits into
Open
Conversation
abagusetty
requested review from
antonwolfy,
ndgrigorian and
vlad-perevezentsev
as code owners
September 2, 2026 17:17
|
Can one of the admins verify this patch? |
Collaborator
antonwolfy
reviewed
Sep 3, 2026
antonwolfy
reviewed
Sep 5, 2026
| * Fixed `dpnp.insert` silently ignoring out-of-bounds negative indices in a multi-element `obj`, so a mix of in-bounds and out-of-bounds indices now consistently raises `IndexError` [#3041](https://github.com/IntelPython/dpnp/pull/3041) | ||
| * Fixed a per-call `sycl::queue` leak in `usm_ndarray::get_queue()`/`get_device()` [#3042](https://github.com/IntelPython/dpnp/pull/3042) | ||
| * Fixed `dpnp.linspace` returning `nan` for equal infinite endpoints [#3043](https://github.com/IntelPython/dpnp/pull/3043) | ||
| * Fixed `dpnp.einsum` returns a result whose memory layout differs from NumPy for the default `order="K"`, and ignores `out` and `order` for a contraction over a size-0 dimension [#3058](https://github.com/IntelPython/dpnp/pull/3058) |
Contributor
There was a problem hiding this comment.
Suggested change
| * Fixed `dpnp.einsum` returns a result whose memory layout differs from NumPy for the default `order="K"`, and ignores `out` and `order` for a contraction over a size-0 dimension [#3058](https://github.com/IntelPython/dpnp/pull/3058) | |
| * Fixed `dpnp.einsum` returning a result whose memory layout differs from NumPy for the default `order="K"`, and ignoring `out` and `order` for a contraction over a size-0 dimension [#3058](https://github.com/IntelPython/dpnp/pull/3058) |
| # a unary einsum without summation returns a view, as NumPy does for every | ||
| # `order` | ||
| if not returns_view: | ||
| if order == "K" and not all_f_contiguous: |
Contributor
There was a problem hiding this comment.
optimize=True now forces the result to C-contiguous, which
- changes behavior that previously matched NumPy on that path
- adds a copy for no functional benefit
This file contains hidden or 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
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.
One more minor layout issue detected during an app-testing in comparison to numpy behavior:
Fixes: #3056