Skip to content

Commit

Permalink
Revert changes to tools/ovc/openvino/
Browse files Browse the repository at this point in the history
Revert changes to tools/ovc/openvino/ beside tools/ovc/openvino/__init__.py
  • Loading branch information
almilosz committed Nov 27, 2024
1 parent 6cf7779 commit ce8c32d
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 25 deletions.
2 changes: 1 addition & 1 deletion tools/ovc/openvino/tools/ovc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
except importlib_metadata.PackageNotFoundError:
optimum_version = None

from openvino._pyopenvino import get_version as get_rt_version # pylint: disable=no-name-in-module,import-error
from openvino.runtime import get_version as get_rt_version # pylint: disable=no-name-in-module,import-error
telemetry = init_ovc_telemetry('OpenVINO')
telemetry.send_event("ov", "import", "general_import")

Expand Down
2 changes: 1 addition & 1 deletion tools/ovc/openvino/tools/ovc/cli_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from typing import List, Union

import openvino
from openvino import PartialShape, Dimension, Type # pylint: disable=no-name-in-module,import-error
from openvino.runtime import PartialShape, Dimension, Type # pylint: disable=no-name-in-module,import-error
from openvino.tools.ovc.error import Error
from openvino.tools.ovc.help import get_convert_model_help_specifics
from openvino.tools.ovc.moc_frontend.shape_utils import to_partial_shape, is_shape_type
Expand Down
2 changes: 1 addition & 1 deletion tools/ovc/openvino/tools/ovc/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pathlib
from typing import Any

from openvino import Model # pylint: disable=no-name-in-module,import-error
from openvino.runtime import Model # pylint: disable=no-name-in-module,import-error
from openvino.tools.ovc.cli_parser import get_all_cli_parser
from openvino.tools.ovc.convert_impl import _convert
from openvino.tools.ovc.logger import get_logger_state, restore_logger_state
Expand Down
4 changes: 2 additions & 2 deletions tools/ovc/openvino/tools/ovc/convert_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@

# pylint: disable=no-name-in-module,import-error
from openvino.frontend import FrontEndManager, OpConversionFailure, TelemetryExtension
from openvino import get_version as get_rt_version
from openvino import PartialShape
from openvino.runtime import get_version as get_rt_version
from openvino.runtime import PartialShape

try:
from openvino.frontend.tensorflow.utils import create_tf_graph_iterator, type_supported_by_tf_fe, \
Expand Down
2 changes: 1 addition & 1 deletion tools/ovc/openvino/tools/ovc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import_openvino_tokenizers()

# pylint: disable=no-name-in-module,import-error
from openvino import save_model
from openvino.runtime import save_model


def main():
Expand Down
5 changes: 2 additions & 3 deletions tools/ovc/openvino/tools/ovc/moc_frontend/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

import json

from openvino import PartialShape, Type
from openvino import Model # pylint: disable=no-name-in-module,import-error
from openvino.utils.types import get_dtype # pylint: disable=no-name-in-module,import-error
from openvino.runtime import PartialShape, Model, Type # pylint: disable=no-name-in-module,import-error
from openvino.runtime.utils.types import get_dtype # pylint: disable=no-name-in-module,import-error


def json_model_analysis_dump(framework_model: Model):
Expand Down
4 changes: 2 additions & 2 deletions tools/ovc/openvino/tools/ovc/moc_frontend/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def convert_params_lists_to_dicts(input_model,
input_user_data_types_dict - dictionary where key is input name, value is type from user;
freeze_placeholder - dictionary where key is input name, value is input value from user;
"""
from openvino import PartialShape # pylint: disable=no-name-in-module,import-error
from openvino.runtime import PartialShape # pylint: disable=no-name-in-module,import-error
model_inputs = input_model.get_inputs()
input_user_data_types_dict = {}
input_user_shapes_dict = {}
Expand All @@ -396,7 +396,7 @@ def convert_params_lists_to_dicts(input_model,

# input_user_data_types is list only if unnamed inputs were used
if isinstance(input_user_data_types, list):
from openvino import Type # pylint: disable=no-name-in-module,import-error
from openvino.runtime import Type # pylint: disable=no-name-in-module,import-error

if input_user_shapes_dict is None:
input_user_shapes_dict = {}
Expand Down
4 changes: 2 additions & 2 deletions tools/ovc/openvino/tools/ovc/moc_frontend/layout_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from typing import Callable

from openvino import PartialShape # pylint: disable=no-name-in-module,import-error
from openvino.runtime import PartialShape # pylint: disable=no-name-in-module,import-error
from openvino.tools.ovc.error import Error
from openvino.tools.ovc.utils import refer_to_faq_msg

Expand Down Expand Up @@ -62,7 +62,7 @@ def get_dimension_index_by_label(input_shape: PartialShape, input_names: list, l
layout = layout_value.get('source_layout', None)
if layout is None:
return default_dim, True
from openvino import Layout # pylint: disable=no-name-in-module,import-error
from openvino.runtime import Layout # pylint: disable=no-name-in-module,import-error
layout_parsed = Layout(layout)
if layout_parsed.has_name(dimension_label):
return layout_parsed.get_index_by_name(dimension_label), False
Expand Down
2 changes: 1 addition & 1 deletion tools/ovc/openvino/tools/ovc/moc_frontend/moc_emit_ir.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import argparse

from openvino import Model # pylint: disable=no-name-in-module,import-error
from openvino.runtime import Model # pylint: disable=no-name-in-module,import-error
from openvino.tools.ovc.moc_frontend.preprocessing import apply_preprocessing


Expand Down
4 changes: 2 additions & 2 deletions tools/ovc/openvino/tools/ovc/moc_frontend/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

from openvino.frontend import FrontEnd, InputModel, NotImplementedFailure, \
Place # pylint: disable=no-name-in-module,import-error
from openvino import PartialShape, Type # pylint: disable=no-name-in-module,import-error
from openvino.utils.types import get_element_type, \
from openvino.runtime import PartialShape, Type # pylint: disable=no-name-in-module,import-error
from openvino.runtime.utils.types import get_element_type, \
get_numpy_ctype # pylint: disable=no-name-in-module,import-error
from openvino.tools.ovc.moc_frontend.analysis import json_model_analysis_dump
from openvino.tools.ovc.moc_frontend.extractor import fe_user_data_repack, convert_params_lists_to_dicts, \
Expand Down
3 changes: 1 addition & 2 deletions tools/ovc/openvino/tools/ovc/moc_frontend/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

from openvino.preprocess import PrePostProcessor # pylint: disable=no-name-in-module,import-error
# pylint: disable=no-name-in-module,import-error
from openvino import Model
from openvino import Layout, PartialShape
from openvino.runtime import Model, Layout, PartialShape
from openvino.tools.ovc.error import Error
from openvino.tools.ovc.moc_frontend.layout_utils import update_layout_to_dict
from openvino.tools.ovc.utils import refer_to_faq_msg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import numpy as np

# pylint: disable=no-name-in-module,import-error
from openvino import Tensor, PartialShape
from openvino.runtime import Tensor, PartialShape
from openvino.tools.ovc.cli_parser import single_input_to_input_cut_info, _InputCutInfo
from openvino.tools.ovc.error import Error

Expand Down
2 changes: 1 addition & 1 deletion tools/ovc/openvino/tools/ovc/moc_frontend/shape_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys

import numpy as np
from openvino import Shape, PartialShape, Dimension # pylint: disable=no-name-in-module,import-error
from openvino.runtime import Shape, PartialShape, Dimension # pylint: disable=no-name-in-module,import-error
from openvino.tools.ovc.error import Error


Expand Down
2 changes: 1 addition & 1 deletion tools/ovc/openvino/tools/ovc/moc_frontend/type_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np

import openvino as ov
from openvino import Type
from openvino.runtime import Type


def is_type(val):
Expand Down
4 changes: 2 additions & 2 deletions tools/ovc/openvino/tools/ovc/telemetry_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import argparse
import numbers
import os
from openvino import get_version as get_rt_version # pylint: disable=no-name-in-module,import-error
from openvino.runtime import get_version as get_rt_version # pylint: disable=no-name-in-module,import-error
from openvino.tools.ovc.cli_parser import get_params_with_paths_list
from openvino.tools.ovc.telemetry_params import telemetry_params
from openvino.tools.ovc.utils import check_values_equal
Expand Down Expand Up @@ -89,7 +89,7 @@ def send_conversion_result(conversion_result: str, need_shutdown=False):

def arg_to_str(arg):
# This method converts to string only known types, otherwise returns string with name of the type
from openvino import PartialShape, Shape, Type, Layout # pylint: disable=no-name-in-module,import-error
from openvino.runtime import PartialShape, Shape, Type, Layout # pylint: disable=no-name-in-module,import-error
if isinstance(arg, (PartialShape, Shape, Type, Layout)):
return str(arg)
if isinstance(arg, (str, numbers.Number, bool)):
Expand Down
4 changes: 2 additions & 2 deletions tools/ovc/openvino/tools/ovc/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import re

from openvino import get_version as get_ie_version # pylint: disable=no-name-in-module,import-error
from openvino.runtime import get_version as get_ie_version # pylint: disable=no-name-in-module,import-error


def extract_release_version(version: str):
Expand All @@ -29,7 +29,7 @@ def simplify_version(version: str):


def get_simplified_ie_version(version=None):
from openvino import get_version # pylint: disable=no-name-in-module,import-error
from openvino.runtime import get_version # pylint: disable=no-name-in-module,import-error
if version is None:
version = get_version()

Expand Down

0 comments on commit ce8c32d

Please sign in to comment.