Thank you.
" * You can export a TorchScript module to ONNX, too. So if the module is traceable, you should be able to do that to get a TorchScript module in C++. Then you can load that into Python and export. Given that ONNX export mostly does tracing internally, too, that might be a viable alternative that skips the “implement the model in Python” step."
This line: “you should be able to do that to get a TorchScript module in C++”, But now, My net is torch::nn::Moudle, how to convert it to torch::jit::Moudule(which is ScriptModule in python) just like the torch.jit.script does?