Convert torch::nn::Module to torch::jit::Module

Is there any way to convert torch::nn::Module to torch::jit::Module in c++? There is nice docs and tutorial available for doing the same in pytorch but my query is specific to libtorch only configuration.