[Numpy-discussion] confused about tensordot

Bradley M. Froehle brad.froehle at gmail.com
Fri Feb 15 11:54:22 EST 2013


Hi Neal:

The tensordot part:
  np.tensordot (a, b.conj(), ((0,),(0,))

is returning a (13, 13) array whose [i, j]-th entry is   sum( a[k, i] *
b.conj()[k, j] for k in xrange(1004) ).

-Brad


The print statement outputs this:
>
> (1004, 13) (1004, 13) (13,) (13, 13)
>
> The correct output should be (13,), but the tensordot output is (13,13).
>
> It's supposed to take 2 matrixes, each (1004, 13) and do element-wise
> multiply,
> then sum over axis 0.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130215/7c7af9a1/attachment.html>


More information about the NumPy-Discussion mailing list