Skip to content

Fix squeeze offset for sliced views - #2933

Open
Tyagiquamar wants to merge 1 commit into
xtensor-stack:masterfrom
Tyagiquamar:fix/squeeze-sliced-view-offset
Open

Tyagiquamar wants to merge 1 commit into
xtensor-stack:masterfrom
Tyagiquamar:fix/squeeze-sliced-view-offset

Conversation

@Tyagiquamar

Copy link
Copy Markdown

Squeezing a sliced view now retains its data offset instead of reading from the start of the underlying tensor. Both squeeze overloads reuse the existing offset helper; expressions without a data interface keep their zero-offset fallback.

Fixes #2834.

Validation in Docker (Ubuntu 24.04, clang 18.1.3, C++20): the added regression failed before the fix with {1,2} instead of {2,3}. After the fix, the focused squeeze tests passed in both row-major and column-major configurations (2 test cases, 12 assertions each). The modified header and test passed clang-format-18 --dry-run --Werror.

This branch has not been deployed

No deployments
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.

BUG: xt::squeeze on a xt::view using xt::range ignore the xt::range

1 participant