title: Dot product along third axis
body: <p>I'm trying to take a tensor dot product in numpy using <code>tensordot</code>, but I'm not sure how I should reshape my arrays to achieve my computation. (I'm still new to the mathematics of tensors, in general.)</p>
  
  <p>I have</p>
  
  <pre><code>arr = np.array([[[1, 1, 1],
                  [0, 0, 0],
                  [2, 2, 2]],
  
                 [[0, 0, 0],
                  [4, 4, 4],
                  [0, 0, 0]]])
  
  w = [1, 1, 1]
  </code></pre>
  
  <p>And I want to take a dot product along <code>axis=2</code>, such that I have the matrix</p>
  
  <pre><code>array([[3, 0, 6],
         [0, 12, 0]])
  </code></pre>
  
  <p>What's the proper numpy syntax for this? <code>np.tensordot(arr, [1, 1, 1], axes=2)</code> seems to raise a <code>ValueError</code>.</p>