You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would also make things like all_equal relatively simple without an intermediate array. For example, the state could be True by default and then f would do state = state && (x_i == x_{i-1}.
You would have to output the state in this case though.
Looking at this again, the logical path would seem to be a gufunc, with reduce just being a special case of one. #8819 is about to provide the ability to work along a single axis. Combined axes or axes=None is less trivial, though (might would need a transpose or ravel preprocessing step).
Activity
eric-wieser commentedon Mar 12, 2017
An alternative way to implement this might be to just allow the ufunc to modify its
reduce_stateparameter directly, like anoutargumentnjsmith commentedon Mar 12, 2017
eric-wieser commentedon Mar 12, 2017
@njsmith : I was wrong about gcd -
ufunc.reduceis already able to handle this.Yes,
gufuncs do provide a more general solution, but they don't support anaxis=argument for the basic case, nor can they beaccumulated.mhvk commentedon Oct 21, 2017
This makes me realize I should get back to #8819, implementing
axesfor gufuncs...hameerabbasi commentedon Feb 27, 2018
This would also make things like
all_equalrelatively simple without an intermediate array. For example, thestatecould beTrueby default and thenfwould dostate = state && (x_i == x_{i-1}.You would have to output the
statein this case though.mhvk commentedon Feb 28, 2018
Looking at this again, the logical path would seem to be a
gufunc, withreducejust being a special case of one. #8819 is about to provide the ability to work along a single axis. Combined axes oraxes=Noneis less trivial, though (might would need atransposeorravelpreprocessing step).