File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -298,7 +298,8 @@ def load_onnx_model(
298298
299299 static_shaped_onnx_path = onnx_path .replace (".onnx" , "_static.onnx" )
300300 save_onnx (onnx_model , static_shaped_onnx_path , use_external_data_format )
301- intermediate_generated_files .append (static_shaped_onnx_path ) # type: ignore[union-attr]
301+ if intermediate_generated_files is not None :
302+ intermediate_generated_files .append (static_shaped_onnx_path )
302303
303304 if TRT_PYTHON_AVAILABLE and platform .system () != "Windows" :
304305 # Check if there's a custom TensorRT op in the ONNX model. If so, make it ORT compatible by adding
@@ -330,7 +331,8 @@ def load_onnx_model(
330331 else onnx_path .replace (".onnx" , f"_ir{ MAX_IR_VERSION } .onnx" )
331332 )
332333 save_onnx (onnx_model , ir_version_onnx_path , use_external_data_format )
333- intermediate_generated_files .append (ir_version_onnx_path ) # type: ignore[union-attr]
334+ if intermediate_generated_files is not None :
335+ intermediate_generated_files .append (ir_version_onnx_path )
334336
335337 # Check that the model is valid
336338 onnx .checker .check_model (onnx_model )
You can’t perform that action at this time.
0 commit comments