<div dir="ltr">Thanks for pointing me to that.  I think its a great match for a 1D case, like the inner product of two arrays in terms of signature.  I don't see how it works with higher dimensional arrays, esp with something like the axis parameter in ufunc.reduce.  With what I proposed for an array of shape (M, N) for example, result.shape could be (1,) or (M, 1) or (1, N) for reducing over the flattened array or either axis.  Can you do something like that with gufunc or do you need to iterate gufunc calls over slices/views?  Thanks again.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 14, 2016 at 8:49 PM, Stephan Hoyer <span dir="ltr"><<a href="mailto:shoyer@gmail.com" target="_blank">shoyer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Mon, Nov 14, 2016 at 5:40 PM, Matthew Harrigan <span dir="ltr"><<a href="mailto:harrigan.matthew@gmail.com" target="_blank">harrigan.matthew@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div>Essentially it creates a reduce for a function which isn't binary.  I think this would be generally useful.</div></div></div></div></div></div></div></div></div></blockquote><div><br></div></span><div>NumPy already has a generic enough interface for creating such ufuncs. In fact, it's called a "generalized ufunc":</div><div><a href="https://docs.scipy.org/doc/numpy/reference/c-api.generalized-ufuncs.html" target="_blank">https://docs.scipy.org/doc/<wbr>numpy/reference/c-api.<wbr>generalized-ufuncs.html</a><br></div><div><br></div><div>I think you could already write "implicit reductions" using gufuncs?</div><div><br></div><div><br></div></div></div></div>
<br>______________________________<wbr>_________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="https://mail.scipy.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.scipy.org/<wbr>mailman/listinfo/numpy-<wbr>discussion</a><br>
<br></blockquote></div><br></div>