<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 22, 2015 at 12:02 AM, Charles R Harris <span dir="ltr"><<a href="mailto:charlesr.harris@gmail.com" target="_blank">charlesr.harris@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"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Thu, May 21, 2015 at 7:06 PM, Alexander Belopolsky <span dir="ltr"><<a href="mailto:ndarray@mac.com" target="_blank">ndarray@mac.com</a>></span> wrote:<br></span><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">1. Is there a simple expression using existing numpy functions that implements <span style="font-size:12.8000001907349px">PEP 465 semantics for @?</span><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">2. Suppose I have a function that takes two vectors x and y, and a matrix M and returns x.dot(M.dot(y)).  I would like to "vectorize" this function so that it works with x and y of any ndim >= 1 and M of any ndim >= 2 treating multi-dimensional x and y as arrays of vectors and M as an array of matrices (broadcasting as necessary).  The result should be an array of xMy products.  How would I achieve that using  </span><span style="font-size:12.8000001907349px">PEP 465's @?</span></div></div>
<br></blockquote><div><br></div></span><div>If you are willing to run Python 3.5 (use 3.6.0a3, a4 crawls with the bugs), you can use <a href="https://github.com/numpy/numpy/pull/5878" target="_blank">gh-5878</a>. The override mechanisms are still in process in Nathaniel's PR, so that may change. I'd welcome any feedback.<br><br></div></div></div></div></blockquote><div><br></div><div>Oops, make the 3.5.0a3.<br><br></div><div>Chuck <br></div></div></div></div>