Gpu trained parameters get different when loading on cpu


I’m using torch 1.8.1+cu101.
I train model on gpu and save it using…) and load it back on cpu using torch.load(…, map_location=‘cpu’).
But the prediction result on cpu is totally different from that on gpu.
I then check the model parameters loaded and the parameters are different on cpu and on gpu.
Why is it?

I’ve already seen

but it still doesn’t work.


Could you post the model definition as well as a minimal code snippet to reproduce the issue of the non-matching parameters, please?