@ptrblck Thank you very much for the explanation.
Yes I am calling model.eval() in both the cases.
So I have ran the test with torch.ones in three different cases;
Since I am training on google colab;

I passed torch.ones just after training finishes. (using ‘gpu’)
I loaded the saved model on colab (using ‘gpu’)
I also loaded the saved model in my local pc. (using ‘cpu’)

Results 2. and 3. match but 1. is different. So that comes under second case you mentioned about forward hook. I actually did not understand how forward hook works.
But let me mention following 2 things;
First, I calculate accuracy in the following way;
 _, predicted = torch.max(pred.data, 1)
total += ys.size(0)
correct += (predicted == ys).sum().item()
train_acc = (100 * correct / total)

Secondly, my model is designed in the following way;
Class model()
    def __init__():
        super()
        ....
        ....

    def forward():
        en = encoder(x)
        out = decoder(en)
        ## Copy pasted ResNet model which takes decoder's input ##
        x = Conv1(out)
        ....
        return pred

I am not sure if this will help in understanding the problem better but it would be great if you can explain forward hook in terms of my model.