I have upload my code and model here:

  
      
      GitHub
  
  
    

kaonick/libtorch-gpu 9

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


  
  
    
    
  
  


that is in same process in one code just switch gpu and cpu.