title: Numpy: Multiplying a matrix with a 3d tensor -- Suggestion
body: <p>I have a matrix <code>P</code> with shape <code>MxN</code> and a 3d tensor <code>T</code> with shape <code>KxNxR</code>. I want to multiply <code>P</code> with every <code>NxR</code> matrix in <code>T</code>, resulting in a <code>KxMxR</code> 3d tensor.</p>
  
  <p><code>P.dot(T).transpose(1,0,2)</code> gives the desired result. Is there a <em>nicer</em> solution (i.e. getting rid of <code>transpose</code>) to this problem? This must be quite a common operation, so I assume, others have found different approaches, e.g. using <code>tensordot</code> (which I tried but failed to get the desired result). Opinions/Views would be highly appreciated!</p>