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);
module_.train();
module_.to(torch::kCUDA);
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:

torchscript.cc:22:27: error: no matching function for call to ‘torch::optim::Adam::Adam(torch::jit::parameter_list)’
   22 |       module_.parameters());

Do i something wrong?