TorchScript and C++


I am trying to load a torch script i C++ as per Loading a TorchScript Model in C++ — PyTorch Tutorials 2.3.0+cu121 documentation, using torch::jit::load. However, I cannot seem to find this function, was it newly added/removed or something? Is the guide out of date? I am running libtorch 2.1.0cu121, but I see people online using it pre v2.0, yet the documentation refers to v2.3.

Thankful for any insights.

Sometimes the imports to Libtorch functions are very well hidden. You can try
#include <torch/csrc/jit/serialization/import.h>