Closed
Description
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
?
Metadata
Metadata
Assignees
Labels
No labels