Well, the basic idea is:
-> load your network
-> load your trained weight into your loaded network
-> load your input data
-> pre-process it
-> feed the input data to your network
-> post-process it
-> show the results
here is an example that i can find
https://github.com/weixu000/libtorch-yolov3-deepsort/tree/master/detection/src 5.
this example is using torch::nn. Note that to load the trained weight into the network, he write his own load function. So, to load the trained weight into the network, you can use torch::load function.
And I have some suggestions for you:

Since you are using RaspBerry Pi, why don’t you use python (instead of using C++) to build your apps?
If you really need to build your apps in C++, maybe you can train your network in python and use TorchScript features from PyTorch. This features is very helpful on deployment.
here are some examples on how to use torchscript:
-> https://github.com/BIGBALLON/PyTorch-CPP/blob/master/prediction.cpp 2
-> https://www.programmersought.com/article/5464871369/


if this answer still doesn’t help, you can start by trying some examples in the documentation (https://pytorch.org/docs/stable/cpp_index.html 3). these examples really help me in understanding how the pytorch c ++ api works
regards,
Albert Christianto