No, I don’t think this will work correctly.
The forward pass in Network2 used the fake inputs, which will create intermediate activations (outputs of layers) and store them. Replacing the loss.data is also quite hacky, but let’s skip this part.
Assuming you are able to replace the loss.data and call backward() on it, the intermediates using the fake input would be used to calculate the backward activations, which will be wrong.