Skip to content

Commit 6be3f1f

Browse files
committed
docs(//README): Add a short example app to README
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent 4a5d6cb commit 6be3f1f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@ More Information / System Architecture:
88

99
- [GTC 2020 Talk](https://developer.nvidia.com/gtc/2020/video/s21671)
1010

11+
## Example Usage
12+
13+
```c++
14+
#include "torch/script.h"
15+
#include "trtorch/trtorch.h"
16+
17+
...
18+
auto compile_settings = trtorch::ExtraInfo(dims);
19+
// FP16 execution
20+
compile_settings.op_precision = torch::kHalf;
21+
// Compile module
22+
auto trt_mod = trtorch::CompileGraph(ts_mod, compile_settings);
23+
// Run like normal
24+
auto results = trt_mod.forward({in_tensor});
25+
...
26+
```
27+
1128
## Platform Support
1229
1330
| Platform | Support |

0 commit comments

Comments
 (0)