Ok, I will try it out.
But I want to put my model and code on github, if you can, please try it out (please pay attention to the operation instructions, choose 1 for CUDA, 2 for CPU).

  
      
      GitHub
  
  
    

kaonick/libtorch-gpu 5

https://discuss.pytorch.org/t/why-same-model-in-cuda-and-cpu-got-different-result/56241/10 - kaonick/libtorch-gpu


  
  
    
    
  
  


You should know it, it seems very strange.
Because the model is not small, please note that if you use the GPU, the GPU RAM should not be too small, otherwise it will be destroyed.