-
Notifications
You must be signed in to change notification settings - Fork 72
[pass] Create version converter pass #2214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
067b361
[pass] Create version converter pass
justinchuby e62f787
format
justinchuby 0a29775
Update onnxscript/version_converter/_version_converter.py
justinchuby f3c1638
doc
justinchuby 9d6b1c8
Update onnxscript/version_converter/_version_converter.py
justinchuby 48bfc65
Fix case
justinchuby ec661aa
converted_proto
justinchuby a57fc86
lint
justinchuby 3d1f428
Update ConvertVersionPass
justinchuby 01ef856
comments
justinchuby 09d44ad
remove
justinchuby baac865
Merge branch 'main' into justinchu/version-pass
justinchuby 4614333
test fallback
justinchuby 188b6cb
rename
justinchuby a87b3c0
Merge branch 'main' into justinchu/version-pass
justinchuby 529ae52
Update onnxscript/version_converter/__init__.py
justinchuby b73398e
Apply suggestions from code review
justinchuby 7e9ca80
Allow fallback
justinchuby 107fb6a
log
justinchuby 9ce3698
arg
justinchuby File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,24 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
from __future__ import annotations | ||
|
||
import pathlib | ||
import unittest | ||
|
||
from onnxscript import ir, version_converter | ||
|
||
model_folder_path = pathlib.Path(__file__).resolve().parent.parent.parent / "testdata" | ||
|
||
|
||
class ModelTest(unittest.TestCase): | ||
def test_model_runs_and_matches_accuracy_after_conversion_fallback_true(self): | ||
model_path = model_folder_path / "e2e_models/torchscript_model/torchscript_model.onnx" | ||
model = ir.load(model_path) | ||
|
||
# Down convert the model with the onnx version converter | ||
version_converter.convert_version(model, target_version=16, fallback=True) | ||
self.assertEqual(model.opset_imports[""], 16) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.