-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
np.max() doesn't behave properly for ndarray subclasses that define __array_ufunc__ #9102
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
Comments
Can you |
Actually, nevermind, I see the issue. @mhvk, your normalization in Why do we do this check at all? |
Similarly for
prints:
Here the issue is that numpy is calling np.logical_or.reduce via |
Thanks, that is most clearly a bug! I'll try to get a fix in asap! |
p.s. The check on |
Actually, no, now that I look at it again, I did this on purpose, mistakenly thinking that |
OK, see #9104. @ngoldbaum - thanks for reporting -- I guess it is likely you'll find more mistakes, but hopefully not more such blatant ones! @eric-wieser - thanks for identifying the bug so quickly. |
See #9106. |
Take the following example:
On numpy 1.13rc1 this prints:
For the call to
arr.max()
numpy calls__array_ufunc__
, but there doesn't seem to be a way to tell from inside__array_ufunc__
that we should be reducing across the whole array and not just the first dimension. I think this would work properly if numpy were calling__array_ufunc__
withaxis=None
.Ping @mhvk
The text was updated successfully, but these errors were encountered: