Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH,WIP: alternative method to implement a where argument to ufunc reductions #12640

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

Closed

Conversation

mhvk
Copy link
Contributor

@mhvk mhvk commented Jan 1, 2019

@seberg - here's an attempt where I force the iterator to feed an axis being reduced to the inner loop. Right now, it just does it, which causes a test failure that expects something else.

An advantage of this approach is that it is now more reasonable to ask people to provide initial for reductions that do not have an identity - it will now not be used to fill in masked items.

But it needs a better way to force the iterator to

  1. Always buffer the input;
  2. Ensure the external loop gets an axis that is being reduced over.

mhvk added 7 commits December 30, 2018 15:53
The iterator masking is unsuited, as it prevents writing back an element
to an array, while what is needed is to skip even reading/operating on an
element.  Might need a double internal loop, where the operand is filled
in with an identity whenever the mask is set.
Since this changes behaviour for cases where it may not be necessary,
this should really involve a new flag!
@mhvk
Copy link
Contributor Author

mhvk commented Jan 2, 2019

closing in favour of the simpler and faster solution in #12644, which doesn't require messing with the iterator.

@mhvk mhvk closed this Jan 2, 2019
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