fix throwing exception for bool type (#8172)
This commit is contained in:
parent
5f7e3cdfb9
commit
9731d9a295
@ -243,6 +243,8 @@ void blob_from_numpy(const py::handle& arr, InferenceEngine::Blob::Ptr blob) {
|
||||
Common::fill_blob<float>(arr, blob);
|
||||
} else if (py::isinstance<py::array_t<double>>(arr)) {
|
||||
Common::fill_blob<double>(arr, blob);
|
||||
} else if (py::isinstance<py::array_t<bool>>(arr)) {
|
||||
Common::fill_blob<bool>(arr, blob);
|
||||
} else if (py::isinstance<py::array_t<int8_t>>(arr)) {
|
||||
Common::fill_blob<int8_t>(arr, blob);
|
||||
} else if (py::isinstance<py::array_t<int16_t>>(arr)) {
|
||||
|
@ -8,8 +8,6 @@ from openvino.impl import Type, Shape
|
||||
from tests.runtime import get_runtime
|
||||
from tests.test_ngraph.util import run_op_node
|
||||
|
||||
from tests import xfail_issue_67415
|
||||
|
||||
|
||||
def test_reverse_sequence():
|
||||
input_data = np.array(
|
||||
@ -180,7 +178,6 @@ def test_pad_constant():
|
||||
assert np.allclose(result, expected)
|
||||
|
||||
|
||||
@xfail_issue_67415
|
||||
def test_select():
|
||||
cond = np.array([[False, False], [True, False], [True, True]])
|
||||
then_node = np.array([[-1, 0], [1, 2], [3, 4]], dtype=np.int32)
|
||||
|
@ -10,7 +10,6 @@ from openvino.impl import AxisSet, Function, Shape, Type
|
||||
from openvino.impl.op import Constant, Parameter
|
||||
from tests.runtime import get_runtime
|
||||
|
||||
from tests import xfail_issue_67415
|
||||
from tests import xfail_issue_54663
|
||||
|
||||
|
||||
@ -523,7 +522,6 @@ def test_axisset():
|
||||
assert set(tuple_axisset) == set(set_axisset)
|
||||
|
||||
|
||||
@xfail_issue_67415
|
||||
def test_select():
|
||||
element_type = Type.f32
|
||||
A = Parameter(Type.boolean, Shape([1, 2]))
|
||||
|
@ -10,8 +10,6 @@ import openvino.opset8 as ov
|
||||
from tests.runtime import get_runtime
|
||||
from tests.test_ngraph.util import run_op_node
|
||||
|
||||
from tests import xfail_issue_67415
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"ng_api_helper,numpy_function",
|
||||
@ -84,7 +82,6 @@ def test_binary_op_with_scalar(ng_api_helper, numpy_function):
|
||||
assert np.allclose(result, expected)
|
||||
|
||||
|
||||
@xfail_issue_67415
|
||||
@pytest.mark.parametrize(
|
||||
"ng_api_helper,numpy_function",
|
||||
[(ov.logical_and, np.logical_and), (ov.logical_or, np.logical_or), (ov.logical_xor, np.logical_xor)],
|
||||
@ -107,7 +104,6 @@ def test_binary_logical_op(ng_api_helper, numpy_function):
|
||||
assert np.allclose(result, expected)
|
||||
|
||||
|
||||
@xfail_issue_67415
|
||||
@pytest.mark.parametrize(
|
||||
"ng_api_helper,numpy_function",
|
||||
[(ov.logical_and, np.logical_and), (ov.logical_or, np.logical_or), (ov.logical_xor, np.logical_xor)],
|
||||
|
@ -9,8 +9,6 @@ from openvino.impl import Shape, Type
|
||||
from tests.runtime import get_runtime
|
||||
from tests.test_ngraph.util import run_op_node
|
||||
|
||||
from tests import xfail_issue_67415
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"ng_api_fn, numpy_fn, range_start, range_end",
|
||||
@ -79,7 +77,6 @@ def test_unary_op_scalar(ng_api_fn, numpy_fn, input_data):
|
||||
assert np.allclose(result, expected)
|
||||
|
||||
|
||||
@xfail_issue_67415
|
||||
@pytest.mark.parametrize(
|
||||
"input_data", [(np.array([True, False, True, False])), (np.array([True])), (np.array([False]))]
|
||||
)
|
||||
|
@ -10,8 +10,6 @@ from openvino.utils.types import make_constant_node
|
||||
from tests.runtime import get_runtime
|
||||
from tests.test_ngraph.util import run_op_node
|
||||
|
||||
from tests import xfail_issue_67415
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"ng_api_helper, numpy_function, reduction_axes",
|
||||
@ -40,7 +38,6 @@ def test_reduction_ops(ng_api_helper, numpy_function, reduction_axes):
|
||||
assert np.allclose(result, expected)
|
||||
|
||||
|
||||
@xfail_issue_67415
|
||||
@pytest.mark.parametrize(
|
||||
"ng_api_helper, numpy_function, reduction_axes",
|
||||
[
|
||||
|
@ -108,48 +108,13 @@ globals().update(backend_test.enable_report().test_cases)
|
||||
tests_expected_to_fail = [
|
||||
(
|
||||
xfail_issue_67415,
|
||||
"OnnxBackendNodeModelTest.test_and2d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_and3d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_and4d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_and_bcast3v1d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_and_bcast3v2d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_and_bcast4v2d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_and_bcast4v3d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_and_bcast4v4d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_cast_FLOAT16_to_DOUBLE_cpu",
|
||||
"OnnxBackendNodeModelTest.test_cast_FLOAT16_to_FLOAT_cpu",
|
||||
"OnnxBackendNodeModelTest.test_castlike_FLOAT16_to_DOUBLE_expanded_cpu",
|
||||
"OnnxBackendNodeModelTest.test_castlike_FLOAT16_to_FLOAT_expanded_cpu",
|
||||
"OnnxBackendNodeModelTest.test_if_cpu",
|
||||
"OnnxBackendNodeModelTest.test_max_float16_cpu",
|
||||
"OnnxBackendNodeModelTest.test_min_float16_cpu",
|
||||
"OnnxBackendNodeModelTest.test_mod_mixed_sign_float16_cpu",
|
||||
"OnnxBackendNodeModelTest.test_not_2d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_not_3d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_not_4d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_or2d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_or3d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_or4d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_or_bcast3v1d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_or_bcast3v2d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_or_bcast4v2d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_or_bcast4v3d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_or_bcast4v4d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_where_example_cpu",
|
||||
"OnnxBackendNodeModelTest.test_where_long_example_cpu",
|
||||
"OnnxBackendNodeModelTest.test_xor2d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_xor3d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_xor4d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_xor_bcast3v1d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_xor_bcast3v2d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_xor_bcast4v2d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_xor_bcast4v3d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_xor_bcast4v4d_cpu",
|
||||
"OnnxBackendNodeModelTest.test_compress_0_cpu",
|
||||
"OnnxBackendNodeModelTest.test_compress_1_cpu",
|
||||
"OnnxBackendNodeModelTest.test_compress_default_axis_cpu",
|
||||
"OnnxBackendNodeModelTest.test_compress_negative_axis_cpu",
|
||||
"OnnxBackendNodeModelTest.test_nonzero_example_cpu",
|
||||
),
|
||||
(
|
||||
xfail_issue_49207,
|
||||
|
@ -7,15 +7,13 @@ import pytest
|
||||
|
||||
from tests.test_onnx.utils import run_node
|
||||
|
||||
from tests import xfail_issue_67415
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"onnx_op, numpy_func, data_type",
|
||||
[
|
||||
pytest.param("And", np.logical_and, np.bool, marks=xfail_issue_67415),
|
||||
pytest.param("Or", np.logical_or, np.bool, marks=xfail_issue_67415),
|
||||
pytest.param("Xor", np.logical_xor, np.bool, marks=xfail_issue_67415),
|
||||
pytest.param("And", np.logical_and, np.bool),
|
||||
pytest.param("Or", np.logical_or, np.bool),
|
||||
pytest.param("Xor", np.logical_xor, np.bool),
|
||||
pytest.param("Equal", np.equal, np.int32),
|
||||
pytest.param("Greater", np.greater, np.int32),
|
||||
pytest.param("Less", np.less, np.int32),
|
||||
@ -37,7 +35,6 @@ def test_logical(onnx_op, numpy_func, data_type):
|
||||
assert np.array_equal(ng_results, [expected_output])
|
||||
|
||||
|
||||
@xfail_issue_67415
|
||||
def test_logical_not():
|
||||
input_data = np.array([[False, True, True], [False, True, False], [False, False, True]])
|
||||
expected_output = np.logical_not(input_data)
|
||||
|
Loading…
Reference in New Issue
Block a user