<p dir="ltr">If you send a patch that deprecates dot's current behaviour for ndim>2, we'll probably merge it. (We'd like it to function like you suggest, for consistency with other gufuncs. But to get there we have to deprecate the current behaviour first.)</p>
<p dir="ltr">While I'm wishing for things I'll also mention that it would be really neat if binary gufuncs would have a .outer method like regular ufuncs do, so anyone currently using ndim>2 dot could just switch to that. But that's a lot more work than just deprecating something :-).</p>
<p dir="ltr">-n</p>
<div class="gmail_quote">On 20 Feb 2014 09:27, "Eric Moore" <<a href="mailto:ewm@redtetrahedron.org">ewm@redtetrahedron.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><br>On Thursday, February 20, 2014, Eelco Hoogendoorn <<a href="mailto:hoogendoorn.eelco@gmail.com" target="_blank">hoogendoorn.eelco@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">If the standard semantics are not affected, and the most common two-argument scenario does not take more than a single if-statement overhead, I don't see why it couldn't be a replacement for the existing np.dot; but others mileage may vary.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 20, 2014 at 11:34 AM, Stefan Otte <span dir="ltr"><<a>stefan.otte@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey,<br>
<br>
so I propose the following. I'll implement a new function `mdot`.<br>
Incorporating the changes in `dot` are unlikely. Later, one can still include<br>
the features in `dot` if desired.<br>
<br>
`mdot` will have a default parameter `optimize`. If `optimize==True` the<br>
reordering of the multiplication is done. Otherwise it simply chains the<br>
multiplications.<br>
<br>
I'll test and benchmark my implementation and create a pull request.<br>
<br>
Cheers,<br>
<div><div> Stefan<br>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a>NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</div></div></blockquote></div><br></div></blockquote><div>Another consideration here is that we need a better way to work with stacked matrices such as np.linalg handles now. Ie I want to compute the matrix product of two (k, n, n) arrays producing a (k,n,n) result. Near as I can tell there isn't a way to do this right now that doesn't involve an explicit loop. Since dot will return a (k, n, k, n) result. Yes this output contains what I want but it also computes a lot of things that I don't want too. </div>
<div><br></div>It would also be nice to be able to do a matrix product reduction, (k, n, n) -> (n, n) in a single line too. <br><div><br></div><div>Eric</div>
<br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div>