diff --git a/advanced_source/torch_script_custom_ops.rst b/advanced_source/torch_script_custom_ops.rst index e2df556884b..55497d5defa 100644 --- a/advanced_source/torch_script_custom_ops.rst +++ b/advanced_source/torch_script_custom_ops.rst @@ -579,13 +579,13 @@ custom operator, that loads and executes a serialized TorchScript model: } // Deserialize the ScriptModule from a file using torch::jit::load(). - std::shared_ptr module = torch::jit::load(argv[1]); + torch::jit::script::Module module = torch::jit::load(argv[1]); std::vector inputs; inputs.push_back(torch::randn({4, 8})); inputs.push_back(torch::randn({8, 5})); - torch::Tensor output = module->forward(std::move(inputs)).toTensor(); + torch::Tensor output = module.forward(std::move(inputs)).toTensor(); std::cout << output << std::endl; }