Skip to content

Commit

Permalink
Update torch_script_custom_ops.rst (#1767)
Browse files Browse the repository at this point in the history
Duplicate of #888. Fixes #910.
  • Loading branch information
holly1238 authored Dec 15, 2021
1 parent 657f138 commit aecb73d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions advanced_source/torch_script_custom_ops.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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<torch::jit::script::Module> module = torch::jit::load(argv[1]);
torch::jit::script::Module module = torch::jit::load(argv[1]);
std::vector<torch::jit::IValue> 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;
}
Expand Down

0 comments on commit aecb73d

Please sign in to comment.