Skip to content

Commit d5bb6b1

Browse files
committed
fix example
1 parent 085a1d6 commit d5bb6b1

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

_doc/examples/plot_export_with_auto.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def forward(self, x, y, z):
4646
# %%
4747
# Then we could make it a different one.
4848

49-
dz = torch.export.Dim("dz") * 2
49+
dz = torch.export.Dim("dz")
5050
try:
5151
ep = torch.export.export(
5252
model,
@@ -84,13 +84,12 @@ def forward(self, x, y, z):
8484
# The same result can be obtained with ``torch.export.Dim.AUTO``.
8585

8686
AUTO = torch.export.Dim.AUTO
87-
print(
88-
torch.export.export(
89-
model,
90-
(x, y, z),
91-
dynamic_shapes=({0: AUTO, 1: AUTO}, {0: AUTO, 1: AUTO}, {0: AUTO, 1: AUTO}),
92-
)
87+
ep = torch.export.export(
88+
model,
89+
(x, y, z),
90+
dynamic_shapes=({0: AUTO, 1: AUTO}, {0: AUTO, 1: AUTO}, {0: AUTO, 1: AUTO}),
9391
)
92+
print(ep)
9493

9594
# %%
9695

0 commit comments

Comments
 (0)