Skip to content

Commit

Permalink
Revert "[Py OV] Add utils to openvino module (openvinotoolkit#28062)"
Browse files Browse the repository at this point in the history
This reverts commit 1dd6492.
  • Loading branch information
ilya-lavrenov committed Dec 24, 2024
1 parent 90fd981 commit 81bfa29
Show file tree
Hide file tree
Showing 28 changed files with 45 additions and 140 deletions.
2 changes: 1 addition & 1 deletion src/bindings/python/src/openvino/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Required for Windows OS platforms
# Note: always top-level
try:
from openvino.package_utils import _add_openvino_libs_to_search_path
from openvino.utils import _add_openvino_libs_to_search_path
_add_openvino_libs_to_search_path()
except ImportError:
pass
Expand Down
22 changes: 22 additions & 0 deletions src/bindings/python/src/openvino/runtime/opset_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2018-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

from typing import Optional
import numpy as np

from openvino.runtime import Node
from openvino.runtime.utils.decorators import nameable_op
from openvino.runtime.utils.node_factory import NodeFactory
from openvino.runtime.utils.types import (
as_node,
NodeInput,
)


def _get_node_factory(opset_version: Optional[str] = None) -> NodeFactory:
"""Return NodeFactory configured to create operators from specified opset version."""
if opset_version:
return NodeFactory(opset_version)
else:
return NodeFactory()

This file was deleted.

2 changes: 1 addition & 1 deletion src/bindings/python/src/openvino/runtime/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

"""Generic utilities. Factor related functions out to separate files."""

from openvino.utils import numpy_to_c, replace_node, replace_output_update_name
from openvino._pyopenvino.util import numpy_to_c, replace_node, replace_output_update_name
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
# SPDX-License-Identifier: Apache-2.0

import logging
from typing import Optional
from typing import List, Optional

from openvino.runtime import AxisSet
from openvino.utils.types import (
from openvino.runtime import AxisSet, Node
from openvino.runtime.utils.types import (
NodeInput,
TensorShape,
get_dtype,
make_constant_node,
)

log = logging.getLogger(__name__)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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
from openvino.runtime.utils.data_helpers.data_dispatcher import _data_dispatch
from openvino.runtime.utils.data_helpers.wrappers import tensor_from_file
from openvino.runtime.utils.data_helpers.wrappers import _InferRequestWrapper
from openvino.runtime.utils.data_helpers.wrappers import OVDict
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import numpy as np

from openvino._pyopenvino import ConstOutput, Tensor, Type, RemoteTensor
from openvino.utils.data_helpers.wrappers import _InferRequestWrapper, OVDict
from openvino.runtime.utils.data_helpers.wrappers import _InferRequestWrapper, OVDict

ContainerTypes = Union[dict, list, tuple, OVDict]
ScalarTypes = Union[np.number, int, float]
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import Any, Callable, Dict, Optional, Union, get_origin, get_args

from openvino.runtime import Node, Output
from openvino.utils.types import NodeInput, as_node, as_nodes
from openvino.runtime.utils.types import NodeInput, as_node, as_nodes


def _get_name(**kwargs: Any) -> Node:
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# Copyright (C) 2018-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

import logging as log

from functools import singledispatchmethod
from functools import partial, singledispatchmethod
from typing import Any, Dict, List, Optional, Union
from pathlib import Path

Expand Down Expand Up @@ -124,11 +125,3 @@ def _arguments_as_outputs(arguments: List[Union[Node, Output]]) -> List[Output]:
else:
outputs.extend(argument.outputs())
return outputs


def _get_node_factory(opset_version: Optional[str] = None) -> NodeFactory:
"""Return NodeFactory configured to create operators from specified opset version."""
if opset_version:
return NodeFactory(opset_version)
else:
return NodeFactory()

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from openvino.runtime.exceptions import OVTypeError
from openvino.runtime import Node, Shape, Output, Type
from openvino.op import Constant
from openvino.runtime.op import Constant

log = logging.getLogger(__name__)

Expand Down
21 changes: 0 additions & 21 deletions src/bindings/python/src/openvino/runtime/utils/types/__init__.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ def _add_openvino_libs_to_search_path() -> None:
if os.path.isdir(os.path.join(os.path.dirname(__file__), "libs")):
# looking for the libs in the pip installation path.
openvino_libs.append(os.path.join(os.path.dirname(__file__), "libs"))
elif os.path.isdir(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, "Library", "bin")):
elif os.path.isdir(os.path.join(os.path.dirname(__file__), "..", "..", "..", "Library", "bin")):
# looking for the libs in the conda installation path
openvino_libs.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, "Library", "bin"))
openvino_libs.append(os.path.join(os.path.dirname(__file__), "..", "..", "..", "Library", "bin"))
else:
# setupvars.bat script set all libs paths to OPENVINO_LIB_PATHS environment variable.
openvino_libs_installer = os.getenv("OPENVINO_LIB_PATHS")
Expand Down
12 changes: 0 additions & 12 deletions src/bindings/python/src/openvino/utils/__init__.py

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion tools/benchmark_tool/openvino/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Required for Windows OS platforms
# Note: always top-level
try:
from openvino.package_utils import _add_openvino_libs_to_search_path
from openvino.utils import _add_openvino_libs_to_search_path
_add_openvino_libs_to_search_path()
except ImportError:
pass
Expand Down
2 changes: 1 addition & 1 deletion tools/mo/openvino/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Required for Windows OS platforms
# Note: always top-level
try:
from openvino.package_utils import _add_openvino_libs_to_search_path
from openvino.utils import _add_openvino_libs_to_search_path
_add_openvino_libs_to_search_path()
except ImportError:
pass
Expand Down
2 changes: 1 addition & 1 deletion tools/openvino_dev/src/openvino/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Required for Windows OS platforms
# Note: always top-level
try:
from openvino.package_utils import _add_openvino_libs_to_search_path
from openvino.utils import _add_openvino_libs_to_search_path
_add_openvino_libs_to_search_path()
except ImportError:
pass
Expand Down
2 changes: 1 addition & 1 deletion tools/ovc/openvino/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Required for Windows OS platforms
# Note: always top-level
try:
from openvino.package_utils import _add_openvino_libs_to_search_path
from openvino.utils import _add_openvino_libs_to_search_path
_add_openvino_libs_to_search_path()
except ImportError:
pass
Expand Down

0 comments on commit 81bfa29

Please sign in to comment.