Skip to content

Potential problem with example code on extending the autograd #18

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

Closed
zli117 opened this issue Apr 2, 2018 · 1 comment
Closed

Potential problem with example code on extending the autograd #18

zli117 opened this issue Apr 2, 2018 · 1 comment

Comments

@zli117
Copy link

zli117 commented Apr 2, 2018

In the example code for extending the autograd (link), in the backward function, grad_output is a Variable, but all the saved variables input, weight, bias are tensors since they got converted before the call of forward. If we invoke mm with mixture of Tensor and Variable, we will get a RuntimeError: mm(): argument 'mat2' (position 1) must be Variable, not torch.FloatTensor error. Should we convert grad_output to Tensor first and then convert the results back to Variable in backward?

@zli117 zli117 closed this as completed Apr 2, 2018
@zli117
Copy link
Author

zli117 commented Apr 2, 2018

NVM. Refreshed and I found it has been fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant