forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Py OV] Add utils to openvino module (openvinotoolkit#28062)
### Details: - Move `runtime/utils/` to openvino - Add proxy locations in `openvino/runtime/utils/` - create proxy for `openvino/runtime/opset_utils.py`. It contained one internal function => `_get_node_factory`. Move its location to `openvino/utils/node_factory.py`. - Rename `utils.py` to `package_utils.py`. Import its functionality in `openvino/utils/__init__.py` so it's accessible for a user in the same way (except internal `_add_openvino_libs_to_search_path` and `_ClassPropertyDescriptor`) NOTE: on Windows `_add_openvino_libs_to_search_path` has to be called (and initialized) on top of `openvino.__init__`, especially before `_pyopenvino` imports. Part of `openvino.runtime` deprecation ### Tickets: [CVS-129450](https://jira.devtools.intel.com/browse/CVS-129450) --------- Signed-off-by: Alicja Miloszewska <[email protected]> Co-authored-by: Anastasia Kuporosova <[email protected]>
- Loading branch information
Showing
28 changed files
with
140 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
src/bindings/python/src/openvino/runtime/opset_utils/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2018-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
||
from openvino.utils.node_factory import _get_node_factory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/bindings/python/src/openvino/runtime/utils/broadcasting/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2018-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from openvino.utils.broadcasting import get_broadcast_axes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/bindings/python/src/openvino/runtime/utils/data_helpers/data_dispatcher/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2018-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
||
from openvino.utils.data_helpers.data_dispatcher import ContainerTypes | ||
from openvino.utils.data_helpers.data_dispatcher import ScalarTypes | ||
from openvino.utils.data_helpers.data_dispatcher import ValidKeys | ||
|
||
from openvino.utils.data_helpers.data_dispatcher import is_list_simple_type | ||
from openvino.utils.data_helpers.data_dispatcher import get_request_tensor | ||
from openvino.utils.data_helpers.data_dispatcher import value_to_tensor | ||
from openvino.utils.data_helpers.data_dispatcher import to_c_style | ||
from openvino.utils.data_helpers.data_dispatcher import normalize_arrays | ||
from openvino.utils.data_helpers.data_dispatcher import create_shared | ||
from openvino.utils.data_helpers.data_dispatcher import set_request_tensor | ||
from openvino.utils.data_helpers.data_dispatcher import update_tensor | ||
from openvino.utils.data_helpers.data_dispatcher import update_inputs | ||
from openvino.utils.data_helpers.data_dispatcher import create_copied | ||
from openvino.utils.data_helpers.data_dispatcher import _data_dispatch |
8 changes: 8 additions & 0 deletions
8
src/bindings/python/src/openvino/runtime/utils/data_helpers/wrappers/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2018-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
||
from openvino.utils.data_helpers.wrappers import tensor_from_file | ||
from openvino.utils.data_helpers.wrappers import _InferRequestWrapper | ||
from openvino.utils.data_helpers.wrappers import OVDict |
13 changes: 13 additions & 0 deletions
13
src/bindings/python/src/openvino/runtime/utils/decorators/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2018-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from openvino.utils.decorators import _get_name | ||
from openvino.utils.decorators import _set_node_friendly_name | ||
from openvino.utils.decorators import nameable_op | ||
from openvino.utils.decorators import unary_op | ||
from openvino.utils.decorators import binary_op | ||
from openvino.utils.decorators import custom_preprocess_function | ||
from openvino.utils.decorators import MultiMethod | ||
from openvino.utils.decorators import registry | ||
from openvino.utils.decorators import overloading |
10 changes: 10 additions & 0 deletions
10
src/bindings/python/src/openvino/runtime/utils/input_validation/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2018-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from openvino.utils.input_validation import assert_list_of_ints | ||
from openvino.utils.input_validation import _check_value | ||
from openvino.utils.input_validation import check_valid_attribute | ||
from openvino.utils.input_validation import check_valid_attributes | ||
from openvino.utils.input_validation import is_positive_value | ||
from openvino.utils.input_validation import is_non_negative_value |
5 changes: 5 additions & 0 deletions
5
src/bindings/python/src/openvino/runtime/utils/node_factory/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2018-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from openvino.utils.node_factory import NodeFactory |
5 changes: 5 additions & 0 deletions
5
src/bindings/python/src/openvino/runtime/utils/reduction/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2018-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from openvino.utils.reduction import get_reduction_axes |
21 changes: 21 additions & 0 deletions
21
src/bindings/python/src/openvino/runtime/utils/types/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2018-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from openvino.utils.types import TensorShape | ||
from openvino.utils.types import NumericData | ||
from openvino.utils.types import NumericType | ||
from openvino.utils.types import ScalarData | ||
from openvino.utils.types import NodeInput | ||
|
||
from openvino.utils.types import openvino_to_numpy_types_map | ||
from openvino.utils.types import openvino_to_numpy_types_str_map | ||
from openvino.utils.types import get_element_type | ||
from openvino.utils.types import get_element_type_str | ||
from openvino.utils.types import get_dtype | ||
from openvino.utils.types import get_numpy_ctype | ||
from openvino.utils.types import get_ndarray | ||
from openvino.utils.types import get_shape | ||
from openvino.utils.types import make_constant_node | ||
from openvino.utils.types import as_node | ||
from openvino.utils.types import as_nodes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2018-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
"""Generic utilities. Factor related functions out to separate files.""" | ||
|
||
from openvino._pyopenvino.util import numpy_to_c, replace_node, replace_output_update_name | ||
|
||
from openvino.package_utils import get_cmake_path | ||
from openvino.package_utils import deprecated | ||
from openvino.package_utils import classproperty | ||
from openvino.package_utils import deprecatedclassproperty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/bindings/python/src/openvino/utils/data_helpers/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2018-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from openvino.utils.data_helpers.data_dispatcher import _data_dispatch | ||
from openvino.utils.data_helpers.wrappers import tensor_from_file | ||
from openvino.utils.data_helpers.wrappers import _InferRequestWrapper | ||
from openvino.utils.data_helpers.wrappers import OVDict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters