Skip to content

Commit

Permalink
Revert "[Py OV] Replace imports of openvino.runtime in openvino module (
Browse files Browse the repository at this point in the history
openvinotoolkit#28166)"

This reverts commit 375ebd2.
  • Loading branch information
ilya-lavrenov committed Dec 24, 2024
1 parent 416bd98 commit 90fd981
Show file tree
Hide file tree
Showing 37 changed files with 107 additions and 102 deletions.
2 changes: 1 addition & 1 deletion src/bindings/python/src/openvino/frontend/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from openvino._pyopenvino import FrontEnd as FrontEndBase
from openvino._pyopenvino import FrontEndManager as FrontEndManagerBase
from openvino._pyopenvino import InputModel
from openvino import Model
from openvino.runtime import Model


class FrontEnd(FrontEndBase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import jax.core
from openvino.frontend.jax.py_jax_frontend import _FrontEndJaxDecoder as Decoder
from openvino import PartialShape, Type as OVType, OVAny
from openvino.runtime import PartialShape, Type as OVType, OVAny
from openvino.frontend.jax.utils import jax_array_to_ov_const, get_ov_type_for_value, \
ivalue_to_constant, param_to_constants

Expand Down
2 changes: 1 addition & 1 deletion src/bindings/python/src/openvino/frontend/jax/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import jax.numpy as jnp
import numpy as np
from openvino.frontend.jax.passes import filter_element, filter_ivalue, filter_param
from openvino import op, Type as OVType, Shape, OVAny
from openvino.runtime import op, Type as OVType, Shape, OVAny

numpy_to_ov_type_map = {
np.float32: OVType.f32,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from openvino.frontend.pytorch.py_pytorch_frontend import _FrontEndPytorchDecoder as Decoder
from openvino.frontend.pytorch.py_pytorch_frontend import _Type as DecoderType
from openvino import PartialShape, Type as OVType, OVAny, Shape
from openvino.runtime import PartialShape, Type as OVType, OVAny, Shape
from openvino.frontend.pytorch.utils import make_constant, fetch_attr, pt_to_ov_type_map, torch_tensor_to_ov_const

logger = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from torch._decomp import decomposition_table, get_decompositions

from openvino.frontend import FrontEndManager
from openvino import Core, Type, PartialShape
from openvino.runtime import Core, Type, PartialShape
from openvino.frontend.pytorch.ts_decoder import TorchScriptPythonDecoder
from openvino.frontend.pytorch.torchdynamo import decompositions
from openvino.frontend.pytorch.torchdynamo.decompositions import get_aot_decomposition_list, get_inf_decomposition_list
Expand All @@ -27,7 +27,7 @@
from openvino.frontend.pytorch.torchdynamo.compile import cached_model_name, openvino_compile_cached_model
from openvino.frontend.pytorch.torchdynamo.backend_utils import _get_cache_dir, _get_device, _get_model_caching, _get_decompositions, _get_aot_autograd

from openvino import Core, Type, PartialShape
from openvino.runtime import Core, Type, PartialShape

logger = logging.getLogger(__name__)
logger.setLevel(logging.WARNING)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# mypy: ignore-errors

from typing import Optional, Any
from openvino import Core
from openvino.runtime import Core


def _get_device(options) -> Optional[Any]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from openvino.frontend import FrontEndManager
from openvino.frontend.pytorch.fx_decoder import TorchFXPythonDecoder
from openvino import Core, Type, PartialShape, serialize
from openvino.runtime import Core, Type, PartialShape, serialize
from openvino.frontend.pytorch.torchdynamo.backend_utils import _get_cache_dir, _get_device, _get_config, _is_cache_dir_in_config

from typing import Callable, Optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from openvino.frontend.pytorch.fx_decoder import TorchFXPythonDecoder
from openvino.frontend.pytorch.torchdynamo.partition import Partitioner
from openvino.frontend.pytorch.torchdynamo.compile import openvino_compile
from openvino import Core, Type, PartialShape
from openvino.runtime import Core, Type, PartialShape
from openvino.frontend.pytorch.torchdynamo.backend_utils import _get_cache_dir, _get_device, _get_aot_autograd

from typing import Callable, Optional, Any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from openvino.frontend.pytorch.py_pytorch_frontend import _FrontEndPytorchDecoder as Decoder
from openvino.frontend.pytorch.py_pytorch_frontend import _Type as DecoderType
from openvino import op, PartialShape, Type as OVType, OVAny
from openvino.runtime import op, PartialShape, Type as OVType, OVAny
from openvino.frontend.pytorch.utils import (
ivalue_to_constant,
get_value_from_getattr,
Expand All @@ -15,7 +15,7 @@
convert_quantized_tensor,
graph_has_ops,
)
from openvino import opset11 as ops
from openvino.runtime import opset11 as ops
from openvino.frontend.pytorch import quantized, patch_model
from openvino.frontend.pytorch.module_extension import ModuleExtension

Expand Down
4 changes: 2 additions & 2 deletions src/bindings/python/src/openvino/frontend/pytorch/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import torch
import numpy as np

from openvino import op, Type as OVType, Shape, Tensor
from openvino import opset11 as ops
from openvino.runtime import op, Type as OVType, Shape, Tensor
from openvino.runtime import opset11 as ops


def make_constant(*args, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
import tensorflow as tf
from openvino.frontend.tensorflow.py_tensorflow_frontend import _FrontEndDecoderBase as DecoderBase
from openvino import PartialShape, Type, OVAny, Tensor
from openvino.runtime import PartialShape, Type, OVAny, Tensor


def tf_type_to_ov_type(tf_type_int):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import logging as log
import numpy as np
import sys
from openvino import PartialShape, Dimension, Type
from openvino.runtime import PartialShape, Dimension, Type
from packaging.version import parse, Version
from typing import List, Dict, Union

Expand Down
2 changes: 1 addition & 1 deletion src/bindings/python/src/openvino/helpers/packing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import numpy as np
from typing import Union
from openvino import Type, Shape
from openvino.runtime import Type, Shape


def pack_data(array: np.ndarray, type: Type) -> np.ndarray:
Expand Down
12 changes: 6 additions & 6 deletions src/bindings/python/src/openvino/opset1/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
import numpy as np
from functools import partial

from openvino import Node, PartialShape, Type
from openvino.runtime import Node, PartialShape, Type
from openvino.op import Constant, Parameter, tensor_iterator
from openvino.utils.node_factory import _get_node_factory
from openvino.utils.decorators import binary_op, nameable_op, unary_op
from openvino.utils.input_validation import (
from openvino.runtime.opset_utils import _get_node_factory
from openvino.runtime.utils.decorators import binary_op, nameable_op, unary_op
from openvino.runtime.utils.input_validation import (
check_valid_attributes,
is_non_negative_value,
is_positive_value,
)
from openvino.utils.node_factory import NodeFactory
from openvino.utils.types import (
from openvino.runtime.utils.node_factory import NodeFactory
from openvino.runtime.utils.types import (
NodeInput,
NumericData,
NumericType,
Expand Down
8 changes: 4 additions & 4 deletions src/bindings/python/src/openvino/opset10/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from functools import partial
from typing import List, Optional

from openvino import Node
from openvino.utils.node_factory import _get_node_factory
from openvino.utils.decorators import nameable_op
from openvino.utils.types import (
from openvino.runtime import Node
from openvino.runtime.opset_utils import _get_node_factory
from openvino.runtime.utils.decorators import nameable_op
from openvino.runtime.utils.types import (
NodeInput,
as_nodes,
as_node,
Expand Down
8 changes: 4 additions & 4 deletions src/bindings/python/src/openvino/opset11/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from functools import partial
from typing import List, Optional

from openvino import Node
from openvino.utils.node_factory import _get_node_factory
from openvino.utils.decorators import nameable_op
from openvino.utils.types import (
from openvino.runtime import Node
from openvino.runtime.opset_utils import _get_node_factory
from openvino.runtime.utils.decorators import nameable_op
from openvino.runtime.utils.types import (
NodeInput,
as_nodes,
)
Expand Down
8 changes: 4 additions & 4 deletions src/bindings/python/src/openvino/opset12/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from functools import partial
from typing import Optional

from openvino import Node
from openvino.utils.node_factory import _get_node_factory
from openvino.utils.decorators import nameable_op
from openvino.utils.types import (
from openvino.runtime import Node
from openvino.runtime.opset_utils import _get_node_factory
from openvino.runtime.utils.decorators import nameable_op
from openvino.runtime.utils.types import (
NodeInput,
as_nodes,
as_node,
Expand Down
8 changes: 4 additions & 4 deletions src/bindings/python/src/openvino/opset13/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

log = logging.getLogger(__name__)

from openvino import Node, Shape, Type, Output, Tensor
from openvino.runtime import Node, Shape, Type, Output, Tensor
from openvino.op import Constant, Result
from openvino.opset1 import convert_like
from openvino.utils.node_factory import _get_node_factory
from openvino.utils.decorators import binary_op, nameable_op, unary_op, overloading
from openvino.utils.types import (
from openvino.runtime.opset_utils import _get_node_factory
from openvino.runtime.utils.decorators import binary_op, nameable_op, unary_op, overloading
from openvino.runtime.utils.types import (
NumericData,
NodeInput,
NumericType,
Expand Down
10 changes: 5 additions & 5 deletions src/bindings/python/src/openvino/opset14/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

from typing import Union, Optional, List

from openvino import Node, Type
from openvino.utils.node_factory import _get_node_factory
from openvino.utils.types import TensorShape
from openvino.utils.decorators import nameable_op
from openvino.utils.types import NodeInput, as_node, as_nodes
from openvino.runtime import Node, Type
from openvino.runtime.opset_utils import _get_node_factory
from openvino.runtime.utils.types import TensorShape
from openvino.runtime.utils.decorators import nameable_op
from openvino.runtime.utils.types import NodeInput, as_node, as_nodes

_get_node_factory_opset14 = partial(_get_node_factory, "opset14")

Expand Down
8 changes: 4 additions & 4 deletions src/bindings/python/src/openvino/opset15/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
from typing import List, Literal, Optional

import numpy as np
from openvino import Node, Type
from openvino.runtime import Node, Type
from openvino.opset1 import convert_like
from openvino.opset14 import constant
from openvino.utils.node_factory import _get_node_factory
from openvino.utils.decorators import binary_op, nameable_op
from openvino.utils.types import NodeInput, as_nodes
from openvino.runtime.opset_utils import _get_node_factory
from openvino.runtime.utils.decorators import binary_op, nameable_op
from openvino.runtime.utils.types import NodeInput, as_nodes

_get_node_factory_opset15 = partial(_get_node_factory, "opset15")

Expand Down
8 changes: 4 additions & 4 deletions src/bindings/python/src/openvino/opset16/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from functools import partial
from typing import Optional

from openvino import Node
from openvino.utils.decorators import nameable_op
from openvino.utils.node_factory import _get_node_factory
from openvino.utils.types import NodeInput, as_nodes
from openvino.runtime import Node
from openvino.runtime.utils.decorators import nameable_op
from openvino.runtime.opset_utils import _get_node_factory
from openvino.runtime.utils.types import NodeInput, as_nodes

_get_node_factory_opset16 = partial(_get_node_factory, "opset16")

Expand Down
11 changes: 6 additions & 5 deletions src/bindings/python/src/openvino/opset2/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@
from functools import partial
import warnings

from openvino import Node, Shape
from openvino.runtime import Node, Shape
from openvino.op import Constant, Parameter
from openvino.utils.decorators import binary_op, nameable_op, unary_op
from openvino.utils.input_validation import (
from openvino.runtime.opset_utils import _get_node_factory
from openvino.runtime.utils.decorators import binary_op, nameable_op, unary_op
from openvino.runtime.utils.input_validation import (
assert_list_of_ints,
check_valid_attributes,
is_non_negative_value,
is_positive_value,
)
from openvino.utils.node_factory import NodeFactory, _get_node_factory
from openvino.utils.types import (
from openvino.runtime.utils.node_factory import NodeFactory
from openvino.runtime.utils.types import (
NodeInput,
NumericData,
NumericType,
Expand Down
11 changes: 6 additions & 5 deletions src/bindings/python/src/openvino/opset3/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@
import numpy as np
from functools import partial

from openvino import Node, Shape
from openvino.runtime import Node, Shape
from openvino.op import Constant, Parameter
from openvino.utils.decorators import binary_op, nameable_op, unary_op
from openvino.utils.input_validation import (
from openvino.runtime.opset_utils import _get_node_factory
from openvino.runtime.utils.decorators import binary_op, nameable_op, unary_op
from openvino.runtime.utils.input_validation import (
assert_list_of_ints,
check_valid_attributes,
is_non_negative_value,
is_positive_value,
)
from openvino.utils.node_factory import NodeFactory, _get_node_factory
from openvino.utils.types import (
from openvino.runtime.utils.node_factory import NodeFactory
from openvino.runtime.utils.types import (
NodeInput,
NumericData,
NumericType,
Expand Down
11 changes: 6 additions & 5 deletions src/bindings/python/src/openvino/opset4/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@
import numpy as np
from functools import partial

from openvino import Node, Shape
from openvino.runtime import Node, Shape
from openvino.op import Constant, Parameter
from openvino.utils.decorators import binary_op, nameable_op, unary_op
from openvino.utils.input_validation import (
from openvino.runtime.opset_utils import _get_node_factory
from openvino.runtime.utils.decorators import binary_op, nameable_op, unary_op
from openvino.runtime.utils.input_validation import (
assert_list_of_ints,
check_valid_attributes,
is_non_negative_value,
is_positive_value,
)
from openvino.utils.node_factory import NodeFactory, _get_node_factory
from openvino.utils.types import (
from openvino.runtime.utils.node_factory import NodeFactory
from openvino.runtime.utils.types import (
NodeInput,
NumericData,
NumericType,
Expand Down
11 changes: 6 additions & 5 deletions src/bindings/python/src/openvino/opset5/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@
import numpy as np
from functools import partial

from openvino import Node, Shape
from openvino.runtime import Node, Shape
from openvino.op import Constant, Parameter, loop
from openvino.utils.decorators import binary_op, nameable_op, unary_op
from openvino.utils.input_validation import (
from openvino.runtime.opset_utils import _get_node_factory
from openvino.runtime.utils.decorators import binary_op, nameable_op, unary_op
from openvino.runtime.utils.input_validation import (
assert_list_of_ints,
check_valid_attributes,
is_non_negative_value,
is_positive_value,
)
from openvino.utils.node_factory import NodeFactory, _get_node_factory
from openvino.utils.types import (
from openvino.runtime.utils.node_factory import NodeFactory
from openvino.runtime.utils.types import (
NodeInput,
NumericData,
NumericType,
Expand Down
8 changes: 4 additions & 4 deletions src/bindings/python/src/openvino/opset6/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

from functools import partial, singledispatch

from openvino import Node, Type, PartialShape, Output, Shape
from openvino.runtime import Node, Type, PartialShape, Output, Shape
from openvino.op import assign, Constant, Parameter
from openvino.op import read_value as _read_value
from openvino.op.util import VariableInfo, Variable
from openvino.utils.node_factory import _get_node_factory
from openvino.utils.decorators import nameable_op, overloading
from openvino.utils.types import (
from openvino.runtime.opset_utils import _get_node_factory
from openvino.runtime.utils.decorators import nameable_op, overloading
from openvino.runtime.utils.types import (
NodeInput,
NumericType,
TensorShape,
Expand Down
Loading

0 comments on commit 90fd981

Please sign in to comment.