Skip to content

Commit c64566a

Browse files
committed
fix: Update function calls to address API changes
1 parent 42ecf57 commit c64566a

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

examples/dynamo/dynamo_compile_resnet_example.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Dynamo Compile ResNet Example
33
=========================
44
5-
This interactive script is intended as a sample of the `torch_tensorrt.dynamo.compile` workflow on a ResNet model."""
5+
This interactive script is intended as a sample of the `torch_tensorrt.compile` workflow with `torch.compile` on a ResNet model."""
66

77
# %%
88
# Imports and Model Definition
@@ -19,7 +19,7 @@
1919
inputs = [torch.randn((1, 3, 224, 224)).to("cuda").half()]
2020

2121
# %%
22-
# Optional Input Arguments to `torch_tensorrt.dynamo.compile`
22+
# Optional Input Arguments to `torch_tensorrt.compile`
2323
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2424

2525
# Enabled precision for TensorRT optimization
@@ -39,13 +39,14 @@
3939
torch_executed_ops = {}
4040

4141
# %%
42-
# Compilation with `torch_tensorrt.dynamo.compile`
42+
# Compilation with `torch_tensorrt.compile`
4343
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4444

4545
# Build and compile the model with torch.compile, using Torch-TensorRT backend
46-
optimized_model = torch_tensorrt.dynamo.compile(
46+
optimized_model = torch_tensorrt.compile(
4747
model,
48-
inputs,
48+
ir="torch_compile",
49+
inputs=inputs,
4950
enabled_precisions=enabled_precisions,
5051
debug=debug,
5152
workspace_size=workspace_size,

examples/dynamo/dynamo_compile_transformers_example.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Dynamo Compile Transformers Example
33
=========================
44
5-
This interactive script is intended as a sample of the `torch_tensorrt.dynamo.compile` workflow on a transformer-based model."""
5+
This interactive script is intended as a sample of the `torch_tensorrt.compile` workflow with `torch.compile` on a transformer-based model."""
66

77
# %%
88
# Imports and Model Definition
@@ -23,7 +23,7 @@
2323

2424

2525
# %%
26-
# Optional Input Arguments to `torch_tensorrt.dynamo.compile`
26+
# Optional Input Arguments to `torch_tensorrt.compile`
2727
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2828

2929
# Enabled precision for TensorRT optimization
@@ -43,13 +43,14 @@
4343
torch_executed_ops = {}
4444

4545
# %%
46-
# Compilation with `torch_tensorrt.dynamo.compile`
46+
# Compilation with `torch_tensorrt.compile`
4747
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4848

49-
# Build and compile the model with torch.compile, using tensorrt backend
50-
optimized_model = torch_tensorrt.dynamo.compile(
49+
# Build and compile the model with torch.compile, using Torch-TensorRT backend
50+
optimized_model = torch_tensorrt.compile(
5151
model,
52-
inputs,
52+
ir="torch_compile",
53+
inputs=inputs,
5354
enabled_precisions=enabled_precisions,
5455
debug=debug,
5556
workspace_size=workspace_size,

0 commit comments

Comments
 (0)