[PyOV] Change default opset9->opset10 (#15238)

This commit is contained in:
Anastasia Kuporosova 2023-02-01 13:44:58 +01:00 committed by GitHub
parent 691ccad997
commit ce287067d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 19 additions and 19 deletions

View File

@ -54,6 +54,7 @@ packages = [
"openvino.runtime.opset7", "openvino.runtime.opset7",
"openvino.runtime.opset8", "openvino.runtime.opset8",
"openvino.runtime.opset9", "openvino.runtime.opset9",
"openvino.runtime.opset10",
"openvino.runtime.utils", "openvino.runtime.utils",
"openvino.runtime.op", "openvino.runtime.op",
"openvino.runtime.op.util", "openvino.runtime.op.util",

View File

@ -13,7 +13,7 @@ from openvino.runtime import Node, Output
from openvino.runtime.exceptions import UserInputError from openvino.runtime.exceptions import UserInputError
DEFAULT_OPSET = "opset9" DEFAULT_OPSET = "opset10"
class NodeFactory(object): class NodeFactory(object):

View File

@ -11,8 +11,7 @@ from openvino.runtime.utils.types import make_constant_node
import openvino.runtime.opset1 as ov_opset1 import openvino.runtime.opset1 as ov_opset1
import openvino.runtime.opset5 as ov_opset5 import openvino.runtime.opset5 as ov_opset5
import openvino.runtime.opset9 as ov import openvino.runtime.opset10 as ov
import openvino.runtime.opset10 as ov_opset10
from openvino.runtime import Type from openvino.runtime import Type
np_types = [np.float32, np.int32] np_types = [np.float32, np.int32]
@ -2146,9 +2145,9 @@ def test_interpolate_opset10(dtype, expected_shape, shape_calculation_mode):
axes = [2, 3] axes = [2, 3]
mode = "cubic" mode = "cubic"
node = ov_opset10.interpolate(image=image_node, output_shape=output_shape, scales=scales, node = ov.interpolate(image=image_node, output_shape=output_shape, scales=scales,
axes=axes, mode=mode, axes=axes, mode=mode,
shape_calculation_mode=shape_calculation_mode) shape_calculation_mode=shape_calculation_mode)
assert node.get_type_name() == "Interpolate" assert node.get_type_name() == "Interpolate"
assert node.get_output_size() == 1 assert node.get_output_size() == 1
assert list(node.get_output_shape(0)) == expected_shape assert list(node.get_output_shape(0)) == expected_shape
@ -2157,7 +2156,7 @@ def test_interpolate_opset10(dtype, expected_shape, shape_calculation_mode):
def test_is_finite_opset10(): def test_is_finite_opset10():
input_shape = [1, 2, 3, 4] input_shape = [1, 2, 3, 4]
input_node = ov.parameter(input_shape, np.float32, name="InputData") input_node = ov.parameter(input_shape, np.float32, name="InputData")
node = ov_opset10.is_finite(input_node) node = ov.is_finite(input_node)
assert node.get_type_name() == "IsFinite" assert node.get_type_name() == "IsFinite"
assert node.get_output_size() == 1 assert node.get_output_size() == 1
@ -2168,7 +2167,7 @@ def test_is_finite_opset10():
def test_is_inf_opset10_default(): def test_is_inf_opset10_default():
input_shape = [2, 2, 2, 2] input_shape = [2, 2, 2, 2]
input_node = ov.parameter(input_shape, dtype=np.float32, name="InputData") input_node = ov.parameter(input_shape, dtype=np.float32, name="InputData")
node = ov_opset10.is_inf(input_node) node = ov.is_inf(input_node)
assert node.get_type_name() == "IsInf" assert node.get_type_name() == "IsInf"
assert node.get_output_size() == 1 assert node.get_output_size() == 1
@ -2185,7 +2184,7 @@ def test_is_inf_opset10_custom_attribute():
attributes = { attributes = {
"detect_positive": False, "detect_positive": False,
} }
node = ov_opset10.is_inf(input_node, attributes) node = ov.is_inf(input_node, attributes)
assert node.get_type_name() == "IsInf" assert node.get_type_name() == "IsInf"
assert node.get_output_size() == 1 assert node.get_output_size() == 1
@ -2203,7 +2202,7 @@ def test_is_inf_opset10_custom_all_attributes():
"detect_negative": False, "detect_negative": False,
"detect_positive": True, "detect_positive": True,
} }
node = ov_opset10.is_inf(input_node, attributes) node = ov.is_inf(input_node, attributes)
assert node.get_type_name() == "IsInf" assert node.get_type_name() == "IsInf"
assert node.get_output_size() == 1 assert node.get_output_size() == 1
@ -2217,7 +2216,7 @@ def test_is_inf_opset10_custom_all_attributes():
def test_is_nan_opset10(): def test_is_nan_opset10():
input_shape = [1, 2, 3, 4] input_shape = [1, 2, 3, 4]
input_node = ov.parameter(input_shape, np.float32, name="InputData") input_node = ov.parameter(input_shape, np.float32, name="InputData")
node = ov_opset10.is_nan(input_node) node = ov.is_nan(input_node)
assert node.get_type_name() == "IsNaN" assert node.get_type_name() == "IsNaN"
assert node.get_output_size() == 1 assert node.get_output_size() == 1
@ -2230,7 +2229,7 @@ def test_unique_opset10():
input_node = ov.parameter(input_shape, np.float32, name="input_data") input_node = ov.parameter(input_shape, np.float32, name="input_data")
axis = ov.constant([1], np.int32, [1]) axis = ov.constant([1], np.int32, [1])
node = ov_opset10.unique(input_node, axis, False, "i32") node = ov.unique(input_node, axis, False, "i32")
assert node.get_type_name() == "Unique" assert node.get_type_name() == "Unique"
assert node.get_sorted() is False assert node.get_sorted() is False
@ -2247,7 +2246,7 @@ def test_unique_opset10():
assert node.get_output_element_type(3) == Type.i64 assert node.get_output_element_type(3) == Type.i64
# Axis default, means flattened result # Axis default, means flattened result
node = ov_opset10.unique(input_node, None, False, "i32", "i32") node = ov.unique(input_node, None, False, "i32", "i32")
assert node.get_type_name() == "Unique" assert node.get_type_name() == "Unique"
assert node.get_sorted() is False assert node.get_sorted() is False
@ -2264,7 +2263,7 @@ def test_unique_opset10():
assert node.get_output_element_type(3) == Type.i32 assert node.get_output_element_type(3) == Type.i32
# All arguments default # All arguments default
node = ov_opset10.unique(input_node) node = ov.unique(input_node)
assert node.get_type_name() == "Unique" assert node.get_type_name() == "Unique"
assert node.get_output_size() == 4 assert node.get_output_size() == 4

View File

@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
from openvino.runtime import Type from openvino.runtime import Type
import openvino.runtime.opset9 as ov import openvino.runtime.opset10 as ov
import numpy as np import numpy as np
import pytest import pytest

View File

@ -2,7 +2,7 @@
# Copyright (C) 2018-2023 Intel Corporation # Copyright (C) 2018-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
import openvino.runtime.opset9 as ov import openvino.runtime.opset10 as ov
import numpy as np import numpy as np
import pytest import pytest

View File

@ -6,7 +6,7 @@ import numpy as np
import pytest import pytest
import openvino.runtime as ov_runtime import openvino.runtime as ov_runtime
import openvino.runtime.opset9 as ov import openvino.runtime.opset10 as ov
from openvino.runtime import Shape, Type from openvino.runtime import Shape, Type
R_TOLERANCE = 1e-6 # global relative tolerance R_TOLERANCE = 1e-6 # global relative tolerance

View File

@ -2,7 +2,7 @@
# Copyright (C) 2018-2023 Intel Corporation # Copyright (C) 2018-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
import openvino.runtime.opset9 as ov import openvino.runtime.opset10 as ov
from openvino.runtime import Shape, Type from openvino.runtime import Shape, Type
import numpy as np import numpy as np
import pytest import pytest

View File

@ -5,7 +5,7 @@
import numpy as np import numpy as np
import pytest import pytest
import openvino.runtime.opset9 as ov import openvino.runtime.opset10 as ov
@pytest.mark.parametrize( @pytest.mark.parametrize(