Thank you, Thomas!
I successfully translated code from Python to C++!
There is the answer:
torch::jit::script::Module module = torch::jit::load("traced_jit_model.pt");
auto input1 = torch::ones({7}).requires_grad_(true);
std::vector<torch::jit::IValue> inputs;
inputs.push_back(input1);
auto output1 = module(inputs);
auto grad_output1 = torch::ones_like(output1.toTensor());
auto gradient1 = torch::autograd::grad({output1.toTensor()}, {input1}, /*grad_outputs=*/{grad_output1}, /*create_graph=*/true);
std::cout << gradient1 << std::endl;

It was quite simplier than I thought!
Best regards,
Igor