I haven’t tried to call Python from C++ and don’t know if this approach would work.
The easier approach might be to script the Python model, load it in your libtorch C++ application and use plain C++ for further processing without going back to Python.