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
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?
The text was updated successfully, but these errors were encountered:
In the example code for extending the autograd (link), in the
backward
function,grad_output
is a Variable, but all the saved variablesinput, weight, bias
are tensors since they got converted before the call offorward
. If we invokemm
with mixture of Tensor and Variable, we will get aRuntimeError: mm(): argument 'mat2' (position 1) must be Variable, not torch.FloatTensor
error. Should we convertgrad_output
to Tensor first and then convert the results back to Variable inbackward
?The text was updated successfully, but these errors were encountered: