Skip to content

Commit 164b132

Browse files
authored
[ONNX] Update PyTorch version and clean up tutorial
Updated prerequisite version of PyTorch and removed optimization section because optimization is now default.
1 parent 702e642 commit 164b132

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

beginner_source/onnx/export_control_flow_model_to_onnx_tutorial.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@
2828
#
2929
# - How to refactor the model to use :func:`torch.cond` for exporting.
3030
# - How to export a model with control flow logic to ONNX.
31-
# - How to optimize the exported model using the ONNX optimizer.
3231
#
3332
# Prerequisites
3433
# ~~~~~~~~~~~~~
3534
#
36-
# * ``torch >= 2.6``
35+
# * ``torch >= 2.8``
3736

3837

3938
import torch
@@ -138,13 +137,6 @@ def neg(x):
138137
onnx_program = torch.onnx.export(model, (x,), dynamo=True)
139138
print(onnx_program.model)
140139

141-
142-
###############################################################################
143-
# We can optimize the model and get rid of the model local functions created to capture the control flow branches.
144-
145-
onnx_program.optimize()
146-
print(onnx_program.model)
147-
148140
###############################################################################
149141
# Conclusion
150142
# ----------

0 commit comments

Comments
 (0)