-
Notifications
You must be signed in to change notification settings - Fork 26.3k
varargs for einsum #10067
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
varargs for einsum #10067
Conversation
implemented via a wrapper Fixes: pytorch#9929
| variants: function | ||
|
|
||
| - func: einsum(std::string equation, TensorList tensors) -> Tensor | ||
| - func: _einsum(std::string equation, TensorList tensors) -> Tensor |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Thanks to fmassa for the suggestion! if the method to fix it is not as pretty, it is my own fault, though.
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SsnL has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
| """ | ||
| if len(operands) == 1 and isinstance(operands[0], (list, tuple)): | ||
| # the old interface of passing the operands as one list argument | ||
| operands = operands[0] |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| return P, L, U | ||
|
|
||
|
|
||
| def einsum(equation, *operands): |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
We don't, torch.functional.einsum (no nn) is imported as torch.einsum.
|
|
Oh I see. Thanks for the clarification @t-vi ! |
|
I think the CI failure isn't this patch. Should we deprecate having a list as second argument? |
|
Let's keep it like this for now and think about if the deprecation should happen later. Could you rebase this pr @t-vi? |
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
soumith has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Implemented via a wrapper, thank you Richard for the suggestion!
Fixes: #9929