Hi,
I want to implement the backward graph separately which means dropping loss.backward() and substituting that with a network that accepts error as input and gives gradients in each layer. For example, for MSE loss it is intuitive to use error = target-output as the input to the backward graph (which is in fully_connected network, is the transposed of the forward graph).
Pytorch loss functions give the loss and not the tensor which is given as input to the backward graph. Is there any easy way to access the input to the backward graph after computing loss? (e.g. loss = nn.CrossEntropyLoss()(outputs, targets))
Thanks