Skip to content

BUG: Fix assert in nditer buffer setup#29780

Merged
mattip merged 1 commit into
numpy:mainfrom
seberg:issue-29690
Sep 22, 2025
Merged

BUG: Fix assert in nditer buffer setup#29780
mattip merged 1 commit into
numpy:mainfrom
seberg:issue-29690

Conversation

@seberg

@seberg seberg commented Sep 22, 2025

Copy link
Copy Markdown
Member

When using a buffered iteration, there was a new assert to check that strides were set up nicely to ensure that we are not missing dimension coalescing.

However, when the strides are set up to track an index, then they were still set up with a 0 for length 1.
I think that is just unnecessary (i.e. the assert is correct to point it out). But, let's do this first for backporting at least.

Closes gh-29690

When using a buffered iteration, there was a new assert to check
that strides were set up nicely to ensure that we are not missing
dimension coalescing.

However, when the strides are set up to track an index, then they
were still set up with a 0 for length 1.
I _think_ that is just unnecessary (i.e. the assert is correct to
point it out).  But, let's do this first for backporting at least.

Signed-off-by: Sebastian Berg <sebastianb@nvidia.com>
@seberg seberg added the 09 - Backport-Candidate PRs tagged should be backported label Sep 22, 2025
@mattip mattip merged commit a5abc5c into numpy:main Sep 22, 2025
78 checks passed
@mattip

mattip commented Sep 22, 2025

Copy link
Copy Markdown
Member

Thanks @seberg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Crash in np.unravel_index if debug assertions enabled.

3 participants