Skip to content

Conversation

@charris
Copy link
Member

@charris charris commented Feb 21, 2021

Backport of #18455.

Closes #18449.

For particularly large input arrays the np.diagflat function could yield non-zero diagonal elements due to integer overflow,
the latter facilitated by the default np.arange integer-dtype being np.int32 on windows.

This PR fixes aforementioned issue by explicitly setting the dtype to np.intp.

@charris charris added this to the 1.20.2 release milestone Feb 21, 2021
@charris charris changed the title BUG: Fixed an issue where diagflat could overflow on windows or 32-bit platforms BUG: diagflat could overflow on windows or 32-bit platforms Feb 21, 2021
@charris charris merged commit 6de68a4 into numpy:maintenance/1.20.x Feb 22, 2021
@charris charris deleted the backport-18455 branch May 3, 2021 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant