The .pth file checkpoint has the computation graph? I see now. The whole time I thought you need the class module that defines the forward(x) to define the computation graph. Then my question is:

In some case I need a output hook for output from certain layer instead of end/ final layer in neural network. How do I create this hook when loading in C++? I’m looking at loading C++ model using libtorch