Skip to content

Commit 4294700

Browse files
committed
fix cpp block
1 parent 39aaf86 commit 4294700

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

advanced_source/cpp_export.rst

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)