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

Reduce doesn't call inner loop for scalars. (Trac #2020) #2613

Closed
numpy-gitbot opened this issue Oct 19, 2012 · 1 comment
Closed

Reduce doesn't call inner loop for scalars. (Trac #2020) #2613

numpy-gitbot opened this issue Oct 19, 2012 · 1 comment

Comments

@numpy-gitbot
Copy link

Original ticket http://projects.scipy.org/numpy/ticket/2020 on 2012-01-15 by @charris, assigned to unknown.

This isn't a problem for current ufuncs, but suppose there was a binary ufunc addrounded(a, b) that added the rounded values of a and b. Then addrounded.reduce(1.5) should be 1, but currently it will just return the element 1.5 without calling the inner loop that would round the result. On the other hand, it would work fine with addrounded.reduce([1.5])

@seberg
Copy link
Member

seberg commented Nov 19, 2022

Closing, seems like a bridge/enhancement to cross when someone actually needs to add such a ufunc. If we really need it, I think it could be done with a flag once gh-20970 is in.

I actually suspect it already works so long you make sure that the reduction has an identity, but if it has not, we cannot call the innerloop anyway.

@seberg seberg closed this as completed Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants