Skip to content

Commit a19f0ad

Browse files
committed
update
1 parent 4eefa34 commit a19f0ad

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

onnxscript/ir/passes/common/_c_api_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ def call_onnx_api(func: Callable[[onnx.ModelProto], _R], model: ir.Model) -> _R:
5858
assert initializer.name is not None
5959
model.graph.initializers.pop(initializer.name)
6060

61+
proto = ir.serde.serialize_model(model)
62+
6163
try:
62-
proto = ir.serde.serialize_model(model)
64+
# Call the ONNX C API function
6365
result = func(proto)
6466
finally:
6567
# Restore the original initializer values so the model is unchanged

0 commit comments

Comments
 (0)