Re: [Numpy-discussion] Generalised inner product

2008-05-19 Thread Peter Creasey
> > c[i,j,k,l,m] = sum (over x) of a[i,j,x] * b[k,x,l,m] > > > > Try tensordot. > > Chuck That was exactly what I needed. Thanks! Peter ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discus

Re: [Numpy-discussion] Generalised inner product

2008-05-19 Thread Charles R Harris
On Mon, May 19, 2008 at 4:23 AM, Peter Creasey < [EMAIL PROTECTED]> wrote: > Hi, > > Does numpy have some sort of generalised inner product? For example I have > arrays > > a.shape = (5,6,7) > b.shape = (8,7,9,10) > > and I want to perform a product over the 3rd axis of a and the 2nd of b, > i.e.

[Numpy-discussion] Generalised inner product

2008-05-19 Thread Peter Creasey
Hi, Does numpy have some sort of generalised inner product? For example I have arrays a.shape = (5,6,7) b.shape = (8,7,9,10) and I want to perform a product over the 3rd axis of a and the 2nd of b, i.e. c[i,j,k,l,m] = sum (over x) of a[i,j,x] * b[k,x,l,m] I guess I could do it with swapaxes an