Following are the scenarios
-
You have a PyTorch model - Use PyTorch C++ Export - https://pytorch.org/tutorials/advanced/cpp_export.html
-
You have model in ONNX - then either use converter to convert into PyTorch model and then step 1
or ONNX to Caffe and then use caffe library
Read here - ONNX: deploying a trained model in a C++ project