[MO] Remove use of mapping file and its generation (#16944)

* [MO] Remove use of mapping file and its generation

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>

* Fix pylinter findings

* Remove usage of mapping file in the layer tests

* Fixing layer tests for legacy frontend

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
This commit is contained in:
Roman Kazantsev
2023-04-15 14:38:33 +04:00
committed by GitHub
parent 507b3251ef
commit 18da874c57
12 changed files with 10 additions and 145 deletions

View File

@@ -18,7 +18,6 @@ from openvino._pyopenvino._offline_transformations import apply_moc_legacy_trans
from openvino._pyopenvino._offline_transformations import apply_pot_transformations
from openvino._pyopenvino._offline_transformations import apply_low_latency_transformation
from openvino._pyopenvino._offline_transformations import apply_pruning_transformation
from openvino._pyopenvino._offline_transformations import generate_mapping_file
from openvino._pyopenvino._offline_transformations import apply_make_stateful_transformation
from openvino._pyopenvino._offline_transformations import compress_model_transformation
from openvino._pyopenvino._offline_transformations import compress_quantize_weights_transformation

View File

@@ -64,11 +64,6 @@ def apply_pruning_transformation(model):
_base.apply_pruning_transformation(model)
@deprecated(version="2023.1", message="The module is private and following namespace " "`offline_transformations` will be removed in " "the future.")
def generate_mapping_file(model, path, extract_names):
_base.generate_mapping_file(model, path, extract_names)
@deprecated(version="2023.1", message="The module is private and following namespace " "`offline_transformations` will be removed in " "the future.")
def apply_make_stateful_transformation(model, param_res_names):
_base.apply_make_stateful_transformation(model, param_res_names)

View File

@@ -7,7 +7,6 @@
#include <pybind11/stl.h>
#include <compress_quantize_weights.hpp>
#include <generate_mapping_file.hpp>
#include <openvino/pass/make_stateful.hpp>
#include <openvino/pass/serialize.hpp>
#include <pot_transformations.hpp>
@@ -85,17 +84,6 @@ void regmodule_offline_transformations(py::module m) {
},
py::arg("model"));
m_offline_transformations.def(
"generate_mapping_file",
[](std::shared_ptr<ov::Model> model, std::string path, bool extract_names) {
ov::pass::Manager manager;
manager.register_pass<ngraph::pass::GenerateMappingFile>(path, extract_names);
manager.run_passes(model);
},
py::arg("model"),
py::arg("path"),
py::arg("extract_names"));
m_offline_transformations.def(
"apply_make_stateful_transformation",
[](std::shared_ptr<ov::Model> model, const std::map<std::string, std::string>& param_res_names) {

View File

@@ -99,7 +99,7 @@ def _check_dict(result, obj, output_names=None):
assert _check_keys(result.keys(), outs)
assert _check_values(result)
assert _check_items(result, outs, output_names)
assert all([output_names[i] in result.names()[i] for i in range(0, len(output_names))])
assert all(output_names[i] in result.names()[i] for i in range(0, len(output_names)))
return True

View File

@@ -39,7 +39,7 @@ def test_init_with_ngraph(ov_type, numpy_dtype):
ov_tensors = []
ov_tensors.append(Tensor(type=ov_type, shape=ov.Shape([1, 3, 32, 32])))
ov_tensors.append(Tensor(type=ov_type, shape=[1, 3, 32, 32]))
assert np.all([list(ov_tensor.shape) == [1, 3, 32, 32] for ov_tensor in ov_tensors])
assert np.all(list(ov_tensor.shape) == [1, 3, 32, 32] for ov_tensor in ov_tensors)
assert np.all(ov_tensor.element_type == ov_type for ov_tensor in ov_tensors)
assert np.all(ov_tensor.data.dtype == numpy_dtype for ov_tensor in ov_tensors)
assert np.all(ov_tensor.data.shape == (1, 3, 32, 32) for ov_tensor in ov_tensors)