Difference between numpy dot() and Python 3.5+ matrix multiplication @
The @ operator calls the array’s __matmul__ method, not dot. This method is also present in the API as the function np.matmul. >>> a = np.random.rand(8,13,13) >>> b = np.random.rand(8,13,13) >>> np.matmul(a, b).shape (8, 13, 13) From the documentation: matmul differs from dot in two important ways. Multiplication by scalars is not allowed. Stacks of … Read more