I wrote a minimal example on how to train a model in pytorch using python and use c++ to load the model and use it. I hope this helps!

  
      
      GitHub
  
  
    

tobiascz/MNIST_Pytorch_python_and_capi 156

This is an example of how to train a MNIST network in Python and run it in c++ with pytorch 1.0  - tobiascz/MNIST_Pytorch_python_and_capi