Thank you for the suggestions.
I changed the loss function to MSELoss and the loss for my modelF starts to decrease. However, it does not give me the same gradients as modelC (computed by loss.backward()). To be able to check what the input to my backward model (modelB) should be, I need to have access to the inputs to backward function within nn.Linear module to be able to compare the input to my backward model (modelB) and the input to the backward function in nn.Module. Is there any way to access to grad_input for my control model (modelC)?