Moved Post-training Optimization Tool to open-source (#7940)

* Moved POT to opensource

* Added OMZ as a submodule

* Exclude OMZ from ShellCheck
This commit is contained in:
Alexander Kozlov
2021-10-15 16:35:35 +03:00
committed by GitHub
parent 2e4514b4df
commit bbeec714aa
412 changed files with 31910 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
# Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from addict import Dict
import pytest
from openvino.tools.pot import OutlierChannelSplitting
from openvino.tools.pot.graph import load_model
from tests.utils.check_graph import check_model
TEST_WEIGHTS_EXPANSION_RATIO = [0.1, 0.5]
TEST_MODEL_NAME = 'outlier_channel_splitting_example'
TEST_MODEL_FRAMEWORK = 'onnx'
@pytest.mark.parametrize('weights_expansion_ratio', TEST_WEIGHTS_EXPANSION_RATIO,
ids=['weights_expansion_ratio_{}'.format(ratio) for ratio in TEST_WEIGHTS_EXPANSION_RATIO])
def test_outlier_channel_splitting_algo(models, tmp_path, weights_expansion_ratio):
algorithm_config = Dict({
'weights_expansion_ratio': weights_expansion_ratio,
})
model = models.get(TEST_MODEL_NAME, TEST_MODEL_FRAMEWORK, tmp_path)
model = load_model(model.model_params)
algorithm = OutlierChannelSplitting(algorithm_config, None)
algorithm.run(model)
check_model(tmp_path, model, TEST_MODEL_NAME + '_{}'.format(weights_expansion_ratio),
TEST_MODEL_FRAMEWORK, check_weights=True)