How to set PyTorch saves its weights as double rather floats

I had to convert my CLDNN model from Keras to Torch. for work reasons.
In order to restore the performance of the model on Keras, the model structure, hy-params,the initialization of weight and bias are still done addcording to my CLDNN model.
The current result is that the classifcation result of torch is 3% less than the result on keras. The performance degardation is fatal in terms of my work.

Keras saves it’s weighted as doubles while PyTorch saves its weights as floats and there is a small amount of truncation error

And my question how to set save my model’s weights as double rather float?

Hi Gavan,
Can you verify if this discussion addresses the same issue as yours? In that case I think it has been resolved earlier by @albanD

Thank you! I tried the method in the link and it works.
However, the performance of the model has not improve yet. :fearful:

Is it possible that you are overlooking some small error? Like I was not calling model.eval() couple days back, and It was giving around 5% more error. Please verify.

I checked all of my model, including the code of the traning and validation process.

And there is nothing wrong with that. Thank you.