Skip to content
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

Add backward conversions from 18->17 for reduce ops #5606

Merged
merged 20 commits into from
Sep 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions onnx/test/automatic_downgrade_test.py
liqunfu marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import numpy as np
from automatic_conversion_test_base import TestAutomaticConversion
liqunfu marked this conversation as resolved.
Show resolved Hide resolved

from onnx import TensorProto, helper
import onnx
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
from onnx import helper

#####################################################################################
# Every test calls _test_op_conversion to downgrade a model from the most recent opset version
Expand All @@ -18,9 +19,9 @@ class TestAutomaticDowngrade(TestAutomaticConversion):
def _test_op_downgrade(self, op, *args, **kwargs):
liqunfu marked this conversation as resolved.
Show resolved Hide resolved
self._test_op_conversion(op, *args, **kwargs, is_upgrade=False)

def test_ReduceOps(self) -> None:
def test_reduce_ops(self) -> None:
liqunfu marked this conversation as resolved.
Show resolved Hide resolved
axes = helper.make_tensor(
"b", TensorProto.INT64, dims=[3], vals=np.array([0, 1, 2])
"b", onnx.TensorProto.INT64, dims=[3], vals=np.array([0, 1, 2])
)
reduce_ops = [
"ReduceL1",
Expand All @@ -40,7 +41,7 @@ def test_ReduceOps(self) -> None:
13,
[[3, 4, 5], [3]],
[[1, 1, 1]],
[TensorProto.FLOAT, TensorProto.INT64],
[onnx.TensorProto.FLOAT, onnx.TensorProto.INT64],
initializer=[axes],
)

Expand Down