File tree Expand file tree Collapse file tree 1 file changed +24
-24
lines changed Expand file tree Collapse file tree 1 file changed +24
-24
lines changed Original file line number Diff line number Diff line change @@ -157,30 +157,30 @@ do:
157157
158158.. code-block :: cpp
159159
160- #include <torch/script.h> // One-stop header.
161-
162- #include <iostream>
163- #include <memory>
164-
165- int main(int argc, const char* argv[]) {
166- if (argc != 2) {
167- std::cerr << "usage: example-app <path-to-exported-script-module>\n ";
168- return -1;
169- }
170-
171- // Deserialize the ScriptModule from a file using torch::jit: :load().
172- torch::jit::script: :Module module;
173- try {
174- module = torch::jit: :load(argv[1]);
175- // Create a vector of inputs.
176- }
177- catch (const c10::Error& e) {
178- std::cerr << "error loading the model\n ";
179- return -1;
180- }
181-
182- std::cout << "ok\n ";
183- }
160+ #include <torch/script.h> // One-stop header.
161+
162+ #include <iostream>
163+ #include <memory>
164+
165+ int main(int argc, const char* argv[]) {
166+ if (argc != 2) {
167+ std::cerr << "usage: example-app <path-to-exported-script-module>\n";
168+ return -1;
169+ }
170+
171+ // Deserialize the ScriptModule from a file using torch::jit::load().
172+ torch::jit::script::Module module;
173+ try {
174+ module = torch::jit::load(argv[1]);
175+ // Create a vector of inputs.
176+ }
177+ catch (const c10::Error& e) {
178+ std::cerr << "error loading the model\n";
179+ return -1;
180+ }
181+
182+ std::cout << "ok\n";
183+ }
184184
185185
186186 The ``<torch/script.h> `` header encompasses all relevant includes from the
You can’t perform that action at this time.
0 commit comments