Pytorch c++ Frontend and torchscript model

Hello together,

I found this blog for pytorch training in c++ (pytorch :: Kushashwa Ravi Shrimali (Kush) — Hello Friend NG HZ Theme). I see how he trained the neuronal network but i have some understanding problems. I see there will be used “torch::load”. Is there a way to load a torchscript model like this?

module_ = torch::jit::load(model_file_path);
torch::optim::Adam optimizer(module_.parameters(),torch::optim::AdamOptions(2e-4).betas(std::make_tuple (0.5, 0.5)));

when i try to compile this i get this error: error: no matching function for call to ‘torch::optim::Adam::Adam(torch::jit::parameter_list)’
   22 |       module_.parameters());

Do i something wrong?