-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Deal with undefined tensors in unbind backward #9995
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
Conversation
When only part of the outputs of unbind are used in a backward, the gradients for the others are undefined. This sets those to zero in to_tensor_list. Fixes: pytorch#9977
|
|
||
| std::vector<Tensor> to_tensor_list(const variable_list& variables) { | ||
| return fmap(variables, [](const Variable &v) { return static_cast<Tensor>(v); } ); | ||
| IntList sizes; |
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.
...to make the code clearer. Based on a review comment by SsnL, thank you!
|
The failure looks like that it might be related to the change. Can you see if it reproduces locally? |
|
The TestCuda.test_index? I cannot reproduce that and in fact I think that might just be the build failure du jour then (a randomly chosen adjacent build had that, too). Could you ask for a rebuild, please? If that fails, I'll take another look. |
|
@pytorchbot retest this please |
|
Thanks! Seems to have worked. :) |
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 is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: When only part of the outputs of unbind are used in a backward, the gradients for the others are undefined. This sets those to zero in to_tensor_list. Fixes: pytorch#9977 Pull Request resolved: pytorch#9995 Differential Revision: D9239610 Pulled By: soumith fbshipit-source-id: eb8d1b3f2b4e615449f9d856e10b946910df9147
Summary: When only part of the outputs of unbind are used in a backward, the gradients for the others are undefined. This sets those to zero in to_tensor_list. Fixes: pytorch#9977 Pull Request resolved: pytorch#9995 Differential Revision: D9239610 Pulled By: soumith fbshipit-source-id: eb8d1b3f2b4e615449f9d856e10b946910df9147
When only part of the outputs of unbind are used in a backward,
the gradients for the others are undefined. This sets those
to zero in to_tensor_list.
Fixes: #9977