Finetuning torchvision models with c++ API

Hi. I was searching for a way to bring torchvision models into c++ and finetune them. I came across this:

and I managed to load some of the pretrained models in c++ but my question is that how can I finetune and save the model. I couldn’t find anything about this online. torch::jit::script::Module has a forward method but doing backward on the loss from the output of forward doesn’t work. What can I do?