Torch::jit::script::module training

Hello everyone. Here is a code to train a torch::jit::script::module :
" ```
torch::jit::script::Module module = torch::jit::load(base_path + “vgg11_back.pt”);
module.train();
std::vectorat::Tensor parameters;
for (const auto& params : module.parameters()) {
parameters.push_back(params);
}
torch::optim::SGD optimizer(parameters, /lr=/0.1);
int epoch = 0;
std::vectortorch::jit::IValue inputs;
inputs.push_back(torch::ones({ 1, 64, 32, 32 }));
torch::Tensor ground_truth = torch::ones({ 1 }).to(at::kLong);
while (epoch < 2) {
optimizer.zero_grad();
at::Tensor output = module.forward(inputs).toTensor();
std::cout << output.slice(/dim=/1, /start=/0, /end=/5) << std::endl;
torch::Tensor loss = torch::nll_loss(output, ground_truth);
std::cout << loss << std::endl;
loss.backward();
optimizer.step();
epoch++;
}"

I want to know if i should save “module” in a pt file to conserve the updated weights or i don’t need to ?

Please, someone answer me