OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[Py OV] Move ie_api.py and exceptions.py files to openvino module (#28007)
Alicja Miloszewskaf7908858d7f9
diff --git a/src/bindings/python/src/openvino/__init__.py b/src/bindings/python/src/openvino/__init__.pyindex e4d1a247520..69c678909b1 100644--- a/src/bindings/python/src/openvino/__init__.py+++ b/src/bindings/python/src/openvino/__init__.py@@ -27,11 +27,11 @@ from openvino import utils as utilsfrom openvino import properties as properties# Import most important classes and functions from openvino.runtime-from openvino.runtime import Model-from openvino.runtime import Core-from openvino.runtime import CompiledModel-from openvino.runtime import InferRequest-from openvino.runtime import AsyncInferQueue+from openvino._ov_api import Model+from openvino._ov_api import Core+from openvino._ov_api import CompiledModel+from openvino._ov_api import InferRequest+from openvino._ov_api import AsyncInferQueuefrom openvino.runtime import Symbolfrom openvino.runtime import Dimension@@ -43,12 +43,13 @@ from openvino.runtime import Typefrom openvino.runtime import Tensorfrom openvino.runtime import OVAny-from openvino.runtime import compile_model+# Helper functions for openvino module+from openvino.runtime.utils.data_helpers import tensor_from_file+from openvino._ov_api import compile_modelfrom openvino.runtime import get_batchfrom openvino.runtime import set_batchfrom openvino.runtime import serializefrom openvino.runtime import shutdown-from openvino.runtime import tensor_from_filefrom openvino.runtime import save_modelfrom openvino.runtime import layout_helpersdiff --git a/src/bindings/python/src/openvino/runtime/ie_api.py b/src/bindings/python/src/openvino/_ov_api.pysimilarity index 100%rename from src/bindings/python/src/openvino/runtime/ie_api.pyrename to src/bindings/python/src/openvino/_ov_api.pydiff --git a/src/bindings/python/src/openvino/runtime/exceptions.py b/src/bindings/python/src/openvino/exceptions.pysimilarity index 100%rename from src/bindings/python/src/openvino/runtime/exceptions.pyrename to src/bindings/python/src/openvino/exceptions.pydiff --git a/src/bindings/python/src/openvino/opset8/ops.py b/src/bindings/python/src/openvino/opset8/ops.pyindex 05b97390baa..6995d55a28a 100644--- a/src/bindings/python/src/openvino/opset8/ops.py+++ b/src/bindings/python/src/openvino/opset8/ops.py@@ -7,7 +7,7 @@ from functools import partialfrom typing import List, Optional, Tupleimport numpy as np-from openvino.runtime.exceptions import UserInputError+from openvino.exceptions import UserInputErrorfrom openvino.op import Constant, Parameter, if_opfrom openvino.runtime import Nodefrom openvino.runtime.opset_utils import _get_node_factorydiff --git a/src/bindings/python/src/openvino/runtime/exceptions/__init__.py b/src/bindings/python/src/openvino/runtime/exceptions/__init__.pynew file mode 100644index 00000000000..18524a21f7d--- /dev/null+++ b/src/bindings/python/src/openvino/runtime/exceptions/__init__.py@@ -0,0 +1,7 @@+# -*- coding: utf-8 -*-+# Copyright (C) 2018-2024 Intel Corporation+# SPDX-License-Identifier: Apache-2.0++from openvino.exceptions import OVError+from openvino.exceptions import UserInputError+from openvino.exceptions import OVTypeErrordiff --git a/src/bindings/python/src/openvino/runtime/ie_api/__init__.py b/src/bindings/python/src/openvino/runtime/ie_api/__init__.pynew file mode 100644index 00000000000..a861224b67e--- /dev/null+++ b/src/bindings/python/src/openvino/runtime/ie_api/__init__.py@@ -0,0 +1,12 @@+# -*- coding: utf-8 -*-+# Copyright (C) 2018-2024 Intel Corporation+# SPDX-License-Identifier: Apache-2.0++from openvino._ov_api import Core+from openvino._ov_api import CompiledModel+from openvino._ov_api import InferRequest+from openvino._ov_api import Model+from openvino._ov_api import AsyncInferQueue++from openvino._ov_api import tensor_from_file+from openvino._ov_api import compile_modeldiff --git a/src/bindings/python/tests/test_runtime/test_ovdict.py b/src/bindings/python/tests/test_runtime/test_ovdict.pyindex e7a5854d66d..cf332bb0997 100644--- a/src/bindings/python/tests/test_runtime/test_ovdict.py+++ b/src/bindings/python/tests/test_runtime/test_ovdict.py@@ -9,7 +9,7 @@ import pytestimport openvino.runtime.opset13 as opsfrom openvino import Core, CompiledModel, InferRequest, Modelfrom openvino.runtime import ConstOutput-from openvino.runtime.ie_api import OVDict+from openvino.runtime.utils.data_helpers import OVDictdef _get_ovdict(diff --git a/tools/benchmark_tool/openvino/__init__.py b/tools/benchmark_tool/openvino/__init__.pyindex e4d1a247520..69c678909b1 100644--- a/tools/benchmark_tool/openvino/__init__.py+++ b/tools/benchmark_tool/openvino/__init__.py@@ -27,11 +27,11 @@ from openvino import utils as utilsfrom openvino import properties as properties# Import most important classes and functions from openvino.runtime-from openvino.runtime import Model-from openvino.runtime import Core-from openvino.runtime import CompiledModel-from openvino.runtime import InferRequest-from openvino.runtime import AsyncInferQueue+from openvino._ov_api import Model+from openvino._ov_api import Core+from openvino._ov_api import CompiledModel+from openvino._ov_api import InferRequest+from openvino._ov_api import AsyncInferQueuefrom openvino.runtime import Symbolfrom openvino.runtime import Dimension@@ -43,12 +43,13 @@ from openvino.runtime import Typefrom openvino.runtime import Tensorfrom openvino.runtime import OVAny-from openvino.runtime import compile_model+# Helper functions for openvino module+from openvino.runtime.utils.data_helpers import tensor_from_file+from openvino._ov_api import compile_modelfrom openvino.runtime import get_batchfrom openvino.runtime import set_batchfrom openvino.runtime import serializefrom openvino.runtime import shutdown-from openvino.runtime import tensor_from_filefrom openvino.runtime import save_modelfrom openvino.runtime import layout_helpersdiff --git a/tools/ovc/openvino/__init__.py b/tools/ovc/openvino/__init__.pyindex e4d1a247520..69c678909b1 100644--- a/tools/ovc/openvino/__init__.py+++ b/tools/ovc/openvino/__init__.py@@ -27,11 +27,11 @@ from openvino import utils as utilsfrom openvino import properties as properties# Import most important classes and functions from openvino.runtime-from openvino.runtime import Model-from openvino.runtime import Core-from openvino.runtime import CompiledModel-from openvino.runtime import InferRequest-from openvino.runtime import AsyncInferQueue+from openvino._ov_api import Model+from openvino._ov_api import Core+from openvino._ov_api import CompiledModel+from openvino._ov_api import InferRequest+from openvino._ov_api import AsyncInferQueuefrom openvino.runtime import Symbolfrom openvino.runtime import Dimension@@ -43,12 +43,13 @@ from openvino.runtime import Typefrom openvino.runtime import Tensorfrom openvino.runtime import OVAny-from openvino.runtime import compile_model+# Helper functions for openvino module+from openvino.runtime.utils.data_helpers import tensor_from_file+from openvino._ov_api import compile_modelfrom openvino.runtime import get_batchfrom openvino.runtime import set_batchfrom openvino.runtime import serializefrom openvino.runtime import shutdown-from openvino.runtime import tensor_from_filefrom openvino.runtime import save_modelfrom openvino.runtime import layout_helpers