From 164b132ec7e14bb82b3da8542c69d95b95d13c39 Mon Sep 17 00:00:00 2001 From: Justin Chu Date: Tue, 16 Sep 2025 10:50:12 -0700 Subject: [PATCH] [ONNX] Update PyTorch version and clean up tutorial Updated prerequisite version of PyTorch and removed optimization section because optimization is now default. --- .../onnx/export_control_flow_model_to_onnx_tutorial.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) 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 # ----------