<br><br><div class="gmail_quote">On Wed, Jan 26, 2011 at 5:23 PM,  <span dir="ltr"><<a href="mailto:josef.pktd@gmail.com">josef.pktd@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 class="im"><snip>
</div>So, if I read the examples correctly we finally get dot along an axis<br>
<br>
np.einsum('ijk,ji->', a, b)<br>
np.einsum('ijk,jik->k', a, b)<br>
<br>
or something like this.<br>
<br>
the notation might require getting used to but it doesn't look worse<br>
than figuring out what tensordot does.<br></blockquote><div><br></div><div>I thought of various extensions to the notation, but the idea is tricky enough as is I think. Decoding a regex-like syntax probably wouldn't help. </div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
The only disadvantage I see, is that choosing the axes to operate on<br>
in a program or function requires string manipulation.<br></blockquote><div> </div><div>One possibility would be for the Python exposure to accept lists or tuples of integers.  The subscript 'ii' could be [(0,0)], and 'ij,jk->ik' could be [(0,1), (1,2), (0,2)].  Internally it would convert this directly to a C-string to pass to the API function.</div>
<div><br></div><div>-Mark</div><div><br></div></div>