From 15da5a3b064a0329cd06ea68c567ba53db941d8f Mon Sep 17 00:00:00 2001 From: Holly Sweeney <77758406+holly1238@users.noreply.github.com> Date: Tue, 14 Dec 2021 15:30:52 -0800 Subject: [PATCH] Update torch_script_custom_ops.rst Duplicate of https://github.com/pytorch/tutorials/pull/888. Fixes https://github.com/pytorch/tutorials/issues/910. --- advanced_source/torch_script_custom_ops.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }