-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into rama/irutils
- Loading branch information
Showing
6 changed files
with
697 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
from __future__ import annotations | ||
|
||
__all__ = [ | ||
# Functions | ||
"convert_version", | ||
] | ||
|
||
from onnxscript import ir | ||
from onnxscript.optimizer import _inliner | ||
from onnxscript.version_converter import _version_converter | ||
|
||
|
||
def convert_version(model: ir.Model, target_version: int) -> None: | ||
"""Convert the model to the specified ONNX opset version.""" | ||
|
||
# In functions, we can have attribute-parameters, which means we don't know the value of the attribute. | ||
# Hence, we inline all the functions. | ||
_inliner.inline(model) | ||
_version_converter.convert_version(model, target_version) |
Oops, something went wrong.