Re: [Numpy-discussion] ENH: compute many inner products quickly

2016-06-05 Thread Mark Daoust
Here's the einsum version: `es = np.einsum('Na,ab,Nb->N',X,A,X)` But that's running ~45x slower than your version. OT: anyone know why einsum is so bad for this one? Mark Daoust On Sat, May 28, 2016 at 11:53 PM, Scott Sievert wrote: > I recently ran into an

Re: [Numpy-discussion] [help needed] associativity and precedence of '@'

2014-03-17 Thread Mark Daoust
stands the difference between a 4D array of scalars, a 3D array of vectors, and a 2D array of matrices... The difference between the axes that broad-cast and the axes that can sum when you hit them with an @ ... or something like that. Just a thought. Einsum is fantastic by the way, totally wort