Skip to content

Commit 06a4ded

Browse files
mergennachinpytorchbot
authored andcommitted
Add examples for CPP demo app (#10022)
(cherry picked from commit 3ec2a7c)
1 parent ef158cc commit 06a4ded

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/source/getting-started.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ print("Comparing against original PyTorch module")
9999
print(torch.allclose(output[0], eager_reference_output, rtol=1e-3, atol=1e-5))
100100
```
101101

102+
For complete examples of exporting and running the model, please refer to our [examples GitHub repository](https://github.com/pytorch-labs/executorch-examples/tree/main/mv2/python).
102103

103104
<hr/>
104105

@@ -178,6 +179,7 @@ target_link_libraries(
178179
xnnpack_backend)
179180
```
180181

182+
181183
#### Runtime APIs
182184
Both high-level and low-level C++ APIs are provided. The low-level APIs are platform independent, do not dynamically allocate memory, and are most suitable for resource-constrained embedded systems. The high-level APIs are provided as a convenience wrapper around the lower-level APIs, and make use of dynamic memory allocation and standard library constructs to reduce verbosity.
183185

@@ -194,8 +196,8 @@ using namespace ::executorch::extension;
194196
Module module("/path/to/model.pte");
195197

196198
// Create an input tensor.
197-
float input[1 * 3 * 256 * 256];
198-
auto tensor = from_blob(input, {1, 3, 256, 256});
199+
float input[1 * 3 * 224 * 224];
200+
auto tensor = from_blob(input, {1, 3, 224, 224});
199201

200202
// Perform an inference.
201203
const auto result = module.forward(tensor);
@@ -208,6 +210,8 @@ if (result.ok()) {
208210
209211
For more information on the C++ APIs, see [Running an ExecuTorch Model Using the Module Extension in C++](extension-module.md) and [Managing Tensor Memory in C++](extension-tensor.md).
210212
213+
For complete examples of building and running C++ application, please refer to our [examples GitHub repository](https://github.com/pytorch-labs/executorch-examples/tree/main/mv2/cpp).
214+
211215
<hr/>
212216
213217
## Next Steps

0 commit comments

Comments
 (0)