title: Difference between numpy dot() and Python 3.5+ matrix multiplication @
body: <p>I recently moved to Python 3.5 and noticed the <a href="https://docs.python.org/3/whatsnew/3.5.html#whatsnew-pep-465" rel="noreferrer">new matrix multiplication operator (@)</a> sometimes behaves differently from the <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.dot.html" rel="noreferrer">numpy dot</a> operator. In example, for 3d arrays:</p>
  
  <pre><code>import numpy as np
  
  a = np.random.rand(8,13,13)
  b = np.random.rand(8,13,13)
  c = a @ b  # Python 3.5+
  d = np.dot(a, b)
  </code></pre>
  
  <p>The <code>@</code> operator returns an array of shape:</p>
  
  <pre><code>c.shape
  (8, 13, 13)
  </code></pre>
  
  <p>while the <code>np.dot()</code> function returns:</p>
  
  <pre><code>d.shape
  (8, 13, 8, 13)
  </code></pre>
  
  <p>How can I reproduce the same result with numpy dot? Are there any other significant differences?</p>