diff --git a/beginner_source/onnx/export_control_flow_model_to_onnx_tutorial.py b/beginner_source/onnx/export_control_flow_model_to_onnx_tutorial.py index c805772713..0b26d281da 100644 --- a/beginner_source/onnx/export_control_flow_model_to_onnx_tutorial.py +++ b/beginner_source/onnx/export_control_flow_model_to_onnx_tutorial.py @@ -28,12 +28,11 @@ # # - How to refactor the model to use :func:`torch.cond` for exporting. # - How to export a model with control flow logic to ONNX. -# - How to optimize the exported model using the ONNX optimizer. # # Prerequisites # ~~~~~~~~~~~~~ # -# * ``torch >= 2.6`` +# * ``torch >= 2.8`` import torch @@ -138,13 +137,6 @@ def neg(x): onnx_program = torch.onnx.export(model, (x,), dynamo=True) print(onnx_program.model) - -############################################################################### -# We can optimize the model and get rid of the model local functions created to capture the control flow branches. - -onnx_program.optimize() -print(onnx_program.model) - ############################################################################### # Conclusion # ----------