Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Relax dtype identity check in reductions #20757

Merged
merged 2 commits into from Jan 7, 2022

Conversation

charris
Copy link
Member

@charris charris commented Jan 6, 2022

Backport of #20729 and #20754.

In some cases, e.g. ensure-native-byte-order will return not the
default, but a copy of the descriptor.

This (and maybe metadata) makes it somewhat annoying to ensure
exact identity between descriptors for reduce "operands" as
returned by the resolve-descirptors method of the ArrayMethod.

To avoid this problem, we check for no-casting (which implies
viewable with offset == 0) rather than strict identity.

Unfortunately, this means that descriptor resolution must be slightly
more careful, but in general this should all be perfectly well
defined.

Closes gh-20699. Closes gh-20751.

In some cases, e.g. ensure-native-byte-order will return not the
default, but a copy of the descriptor.

This (and maybe metadata) makes it somewhat annoying to ensure
exact identity between descriptors for reduce "operands" as
returned by the resolve-descirptors method of the ArrayMethod.

To avoid this problem, we check for no-casting (which implies
viewable with `offset == 0`) rather than strict identity.

Unfortunately, this means that descriptor resolution must be slightly
more careful, but in general this should all be perfectly well
defined.

Closes numpygh-20699
@charris charris added this to the 1.22.1 release milestone Jan 6, 2022
This closes numpygh-20751, which was due to the assert not being noticed
triggered (not sure why) during initial CI run.
The behaviour is relaxed, so the assert must also be relaxed.
@charris charris merged commit 6b6605f into numpy:maintenance/1.22.x Jan 7, 2022
@charris charris deleted the backport-20729-20754 branch January 7, 2022 00:01
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.

None yet

2 participants