title: Numpy element-wise dot product
body: <p>is there an elegant, numpy way to apply the dot product elementwise? Or how can the below code be translated into a nicer version?</p>
  
  <pre><code>m0 # shape (5, 3, 2, 2)
  m1 # shape (5,    2, 2)
  r = np.empty((5, 3, 2, 2))
  for i in range(5):
      for j in range(3):
          r[i, j] = np.dot(m0[i, j], m1[i])
  </code></pre>
  
  <p>Thanks in advance!</p>