removal of compatibility tests executing models with dynamic shapes (#11751)
This commit is contained in:
parent
c73201c9e6
commit
15d64d25af
@ -135,7 +135,8 @@ xfail_issue_63137 = xfail_test(reason="Unsupported operations: OptionalHasElemen
|
||||
xfail_issue_63138 = xfail_test(reason="Missing ONNX Shape-15 support")
|
||||
|
||||
xfail_issue_78843 = xfail_test(reason="Missing reference output files for ssd mobilenet models")
|
||||
xfail_issue_78741 = xfail_test(reason="Cannot get dims for non static shape")
|
||||
xfail_issue_78741 = xfail_test(reason="Cannot get dims for non-static shapes. "
|
||||
"Requires dynamism support enabled.")
|
||||
|
||||
xfail_issue_81974 = xfail_test(reason="RuntimeError: OpenVINO does not support the following ONNX "
|
||||
"operations: GridSample, Optional, SequenceConstruct, "
|
||||
|
@ -6,7 +6,6 @@ import numpy as np
|
||||
import ngraph as ng
|
||||
from tests_compatibility.runtime import get_runtime
|
||||
from tests_compatibility.test_ngraph.util import run_op_node
|
||||
from tests_compatibility import xfail_issue_78741
|
||||
|
||||
|
||||
def test_onehot():
|
||||
@ -19,26 +18,3 @@ def test_onehot():
|
||||
input_data = np.array([1, 0, 2], dtype=np.int32)
|
||||
result = computation(input_data)
|
||||
assert np.allclose(result, expected)
|
||||
|
||||
|
||||
@xfail_issue_78741
|
||||
def test_one_hot():
|
||||
data = np.array([0, 1, 2], dtype=np.int32)
|
||||
depth = 2
|
||||
on_value = 5
|
||||
off_value = 10
|
||||
axis = -1
|
||||
excepted = [[5, 10], [10, 5], [10, 10]]
|
||||
|
||||
result = run_op_node([data, depth, on_value, off_value], ng.one_hot, axis)
|
||||
assert np.allclose(result, excepted)
|
||||
|
||||
|
||||
@xfail_issue_78741
|
||||
def test_range():
|
||||
start = 5
|
||||
stop = 35
|
||||
step = 5
|
||||
|
||||
result = run_op_node([start, stop, step], ng.range)
|
||||
assert np.allclose(result, [5, 10, 15, 20, 25, 30])
|
||||
|
@ -16,8 +16,7 @@ from tests_compatibility.test_onnx.utils import (
|
||||
)
|
||||
from tests_compatibility import (xfail_issue_35927,
|
||||
xfail_issue_44858,
|
||||
xfail_issue_44968,
|
||||
xfail_issue_78741)
|
||||
xfail_issue_44968)
|
||||
|
||||
|
||||
def test_reshape():
|
||||
@ -306,70 +305,6 @@ def test_split_2d(node, expected_output):
|
||||
assert all_arrays_equal(ng_results, expected_output)
|
||||
|
||||
|
||||
@xfail_issue_78741
|
||||
def test_split_2d_splits_input():
|
||||
data = np.arange(8, dtype=np.int32).reshape(2, 4)
|
||||
splits = np.array([3, 1]).astype(np.int64)
|
||||
node = onnx.helper.make_node(
|
||||
"Split", inputs=["x", "splits"], outputs=["a", "b"], axis=1
|
||||
)
|
||||
expected_outputs = [
|
||||
np.array([[0, 1, 2], [4, 5, 6]], dtype=np.int32),
|
||||
np.array([[3], [7]], dtype=np.int32),
|
||||
]
|
||||
ng_results = run_node(node, [data, splits])
|
||||
assert all_arrays_equal(ng_results, expected_outputs)
|
||||
|
||||
|
||||
@xfail_issue_78741
|
||||
def test_split_1d():
|
||||
# 1D
|
||||
data = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0]).astype(np.float32)
|
||||
|
||||
node = onnx.helper.make_node("Split", inputs=["input"], outputs=["z", "w"], axis=0)
|
||||
expected_outputs = [
|
||||
np.array([1.0, 2.0, 3.0]).astype(np.float32),
|
||||
np.array([4.0, 5.0, 6.0]).astype(np.float32),
|
||||
]
|
||||
ng_results = run_node(node, [data])
|
||||
assert all_arrays_equal(ng_results, expected_outputs)
|
||||
|
||||
splits = np.array([2, 3, 1]).astype(np.int64)
|
||||
node = onnx.helper.make_node(
|
||||
"Split", inputs=["input", "splits"], outputs=["y", "z", "w"], axis=0
|
||||
)
|
||||
expected_outputs = [
|
||||
np.array([1.0, 2.0]).astype(np.float32),
|
||||
np.array([3.0, 4.0, 5.0]).astype(np.float32),
|
||||
np.array([6.0]).astype(np.float32),
|
||||
]
|
||||
ng_results = run_node(node, [data, splits])
|
||||
assert all_arrays_equal(ng_results, expected_outputs)
|
||||
|
||||
# Default values
|
||||
data = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0]).astype(np.float32)
|
||||
|
||||
node = onnx.helper.make_node("Split", inputs=["input"], outputs=["y", "z", "w"])
|
||||
expected_outputs = [
|
||||
np.array([1.0, 2.0]).astype(np.float32),
|
||||
np.array([3.0, 4.0]).astype(np.float32),
|
||||
np.array([5.0, 6.0]).astype(np.float32),
|
||||
]
|
||||
ng_results = run_node(node, [data])
|
||||
assert all_arrays_equal(ng_results, expected_outputs)
|
||||
|
||||
splits = np.array([2, 4]).astype(np.int64)
|
||||
node = onnx.helper.make_node(
|
||||
"Split", inputs=["input", "splits"], outputs=["y", "z"]
|
||||
)
|
||||
expected_outputs = [
|
||||
np.array([1.0, 2.0]).astype(np.float32),
|
||||
np.array([3.0, 4.0, 5.0, 6.0]).astype(np.float32),
|
||||
]
|
||||
ng_results = run_node(node, [data, splits])
|
||||
assert all_arrays_equal(ng_results, expected_outputs)
|
||||
|
||||
|
||||
def test_depth_to_space():
|
||||
b, c, h, w = shape = (2, 8, 3, 3)
|
||||
blocksize = 2
|
||||
|
Loading…
Reference in New Issue
Block a user