hi, I want to train/test and generate jit::script structure totally in C++ code.
simply, I want to trace modules implemented in totally libtorch C++.
Always torch provides save script in python and load script in C++. But, I want to use script in C++ directly from modules same namespace C++. is it possible?
I declared a class for all definitions of Network, and composed a register module and each forward function. Both training and testing work fine.
I would like to convert it into a script form made directly from this class Model, not a .pt file made from Pytorch.
In Python, I can pass the network through the trace function to figure out the structure, but libtorch c++ doesn’t seem to provide such a function.
The Model class I use can be accessed through a function like Model->named_modules().
However, I couldn’t find a function like ‘trace function’ or a way to convert it to torch::jit:script:Module form.
Any example code that might help?