Yes, I meant gradients: cost = X2.grad.cpu().detach()
I hope my understanding here is not fundamentally broken and those are the same thing … ?
Is there a difference between taking the the .grad from the inputs of the first module (if I set those to require gradient) and doing it via autograd.grad?
But anyway, I’ll try doing the backprop on the first module via autograd.grad and passing the .grad from the inputs of the second module (after backprop has been done on that the usual way).