Alexander Belopolsky
2015-05-22 01:06:46 UTC
1. Is there a simple expression using existing numpy functions that
implements PEP 465 semantics for @?
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 PEP 465's @?
implements PEP 465 semantics for @?
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 PEP 465's @?