You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Major slowdown as einsum optimize path used even for two arguments #10357
While looking at #10343 and #10352, I wondered why optimization is attempted for only 2 inputs, when there is obviously nothing to optimize. The slowdown is dramatic, a factor of 25 (enough to label this a regression):
a = np.eye(3)
b = np.arange(3)
%timeit np.einsum('...ij,j...->i...', a, b)
# 10000 loops, best of 3: 87.7 µs per loop
%timeit np.einsum('...ij,j...->i...', a, b, optimize=False)
# 100000 loops, best of 3: 3.52 µs per loop
Activity
BUG: do not optimize einsum with only 2 arguments.