title: A loopless 3D matrix multiplication in python
body: <p>I am looking to do the following operation in python (numpy). </p>
  
  <pre><code>Matrix A is M x N x R
  Matrix B is N x 1 x R
  </code></pre>
  
  <p>Matrix multiply AB = C, where C is a M x 1 x R matrix.
  Essentially each M x N layer of A (R of them) is matrix multiplied independently by each N x 1 vector in B.  I am sure this is a one-liner.  I have been trying to use tensordot(), but I that seems to be giving me answers that I don't expect. </p>
  
  <p>I have been programming in Igor Pro for nearly 10 years, and I am now trying to convert pages of it over to python.</p>