-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Einsum gets slow with multiple arguments #5366
Comments
I'm not an einsum expert, so I don't know what
You want something like
This is still slower than
|
Someone more in the know may want to correct me, but I looked at something related to this a while back, and my conclusion was that what tripped A much simpler example:
In the first instance, the dot product of I don't think this qualifies as a bug, and I am not even sure a general case enhancement is a viable option: you would need to come up with an algorithm that detects groups of operands that could be collapsed, and if some of the operands belong to more than one group, decide in what order to do the collapsing. For the chained matrix multiplication this is solved with a more or less standard DP algorithm, as in |
@njsmith: Thanks, that's what I get for not sanity checking. Your example is the one I had initially run across. @jaimefrio Ok, that makes sense. I think my mental model for how einsum works was off. I'm not sure how to make the docs clearer, though. |
Closing. |
With multiple arguments,
einsum
blows up fast:Is there some fundamental limitation involved, or is this a bug?
The text was updated successfully, but these errors were encountered: