Skip to content

Commit dc16f0e

Browse files
committed
minor updates to dynamic shape notebook
Signed-off-by: tanayvarshney <[email protected]>
1 parent 3386510 commit dc16f0e

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

notebooks/Dynamic_Shapes_Torch_TRT.ipynb

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"cell_type": "code",
55
"execution_count": 1,
6-
"id": "b35ad257",
6+
"id": "332a2ed8",
77
"metadata": {},
88
"outputs": [],
99
"source": [
@@ -54,7 +54,7 @@
5454
"---\n",
5555
"## TL;DR Explanation\n",
5656
"\n",
57-
"Making use of Dynamic Shaped Tensors in Torch TensorRT is quite simple. Let's say you are using the `torch_tensorrt.ts.compile(...)` function to compile a torchscript module.\n",
57+
"Making use of Dynamic Shaped Tensors in Torch TensorRT is quite simple. Let's say you are using the `torch_tensorrt.compile(...)` function to compile a torchscript module.\n",
5858
"\n",
5959
"One of the `args` in this function in this function is `input`: which defines an input to a module in terms of expected shape, data type and tensor format: `torch_tensorrt.Input`. \n",
6060
"\n",
@@ -185,7 +185,7 @@
185185
},
186186
{
187187
"cell_type": "markdown",
188-
"id": "eeed79b2",
188+
"id": "0ed1b4f7",
189189
"metadata": {},
190190
"source": [
191191
"---\n",
@@ -199,7 +199,7 @@
199199
},
200200
{
201201
"cell_type": "markdown",
202-
"id": "70167e4e",
202+
"id": "5934504f",
203203
"metadata": {},
204204
"source": [
205205
"### Getting sample data"
@@ -335,7 +335,7 @@
335335
},
336336
{
337337
"cell_type": "markdown",
338-
"id": "b6a304d7",
338+
"id": "1374edab",
339339
"metadata": {},
340340
"source": [
341341
"### Download model from torch hub."
@@ -553,7 +553,7 @@
553553
},
554554
{
555555
"cell_type": "markdown",
556-
"id": "52a757b9",
556+
"id": "0a67e8db",
557557
"metadata": {},
558558
"source": [
559559
"### Build simple utility functions"
@@ -631,7 +631,7 @@
631631
},
632632
{
633633
"cell_type": "markdown",
634-
"id": "3910e6f4",
634+
"id": "21402d53",
635635
"metadata": {},
636636
"source": [
637637
"Let's test our util functions on the model we have set up, starting with simple predictions"
@@ -682,7 +682,7 @@
682682
},
683683
{
684684
"cell_type": "markdown",
685-
"id": "faae88ce",
685+
"id": "2fc7f347",
686686
"metadata": {},
687687
"source": [
688688
"Onwards, to benchmarking."
@@ -734,21 +734,21 @@
734734
},
735735
{
736736
"cell_type": "markdown",
737-
"id": "580161c1",
737+
"id": "cd233b85",
738738
"metadata": {},
739739
"source": [
740740
"With the baseline ready, we can proceed to the section working discussing dynamic shapes!"
741741
]
742742
},
743743
{
744744
"cell_type": "markdown",
745-
"id": "e2c28c95",
745+
"id": "bd5746da",
746746
"metadata": {},
747747
"source": [
748748
"---\n",
749749
"## Working with Dynamic shapes in Torch TRT\n",
750750
"\n",
751-
"Enabling \"Dynamic Shaped\" tensors to be used is essentially enabling the ability to defer defining the shape of tensors until runetime. Torch TensorRT simply leverages TensorRT's Dynamic shape support. You can read more about TensorRT's implementation in the [TensorRT Documentation](https://docs.nvidia.com/deeplearning/tensorrt/developer-guide/index.html#work_dynamic_shapes)\n",
751+
"Enabling \"Dynamic Shaped\" tensors to be used is essentially enabling the ability to defer defining the shape of tensors until runetime. Torch TensorRT simply leverages TensorRT's Dynamic shape support. You can read more about TensorRT's implementation in the [TensorRT Documentation](https://docs.nvidia.com/deeplearning/tensorrt/developer-guide/index.html#work_dynamic_shapes).\n",
752752
"\n",
753753
"#### How can you use this feature?\n",
754754
"\n",
@@ -958,6 +958,16 @@
958958
"source": [
959959
"benchmark(model, input_shape=(32, 3, 224, 224), nruns=100)"
960960
]
961+
},
962+
{
963+
"cell_type": "markdown",
964+
"id": "f87a75bd",
965+
"metadata": {},
966+
"source": [
967+
"## What's Next?\n",
968+
"\n",
969+
"Check out the [TensorRT Getting started page](https://developer.nvidia.com/tensorrt-getting-started) for more tutorials, or visit the Torch-TensorRT [documentation](https://nvidia.github.io/Torch-TensorRT/) for more information!"
970+
]
961971
}
962972
],
963973
"metadata": {

0 commit comments

Comments
 (0)