Skip to content

Commit aecb73d

Browse files
authored
Update torch_script_custom_ops.rst (#1767)
Duplicate of #888. Fixes #910.
1 parent 657f138 commit aecb73d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

advanced_source/torch_script_custom_ops.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -579,13 +579,13 @@ custom operator, that loads and executes a serialized TorchScript model:
579579
}
580580
581581
// Deserialize the ScriptModule from a file using torch::jit::load().
582-
std::shared_ptr<torch::jit::script::Module> module = torch::jit::load(argv[1]);
582+
torch::jit::script::Module module = torch::jit::load(argv[1]);
583583
584584
std::vector<torch::jit::IValue> inputs;
585585
inputs.push_back(torch::randn({4, 8}));
586586
inputs.push_back(torch::randn({8, 5}));
587587
588-
torch::Tensor output = module->forward(std::move(inputs)).toTensor();
588+
torch::Tensor output = module.forward(std::move(inputs)).toTensor();
589589
590590
std::cout << output << std::endl;
591591
}

0 commit comments

Comments
 (0)