Files
openvino/model-optimizer/extensions/ops/resize_factor_utils.py
Alexey Suhov 6478f1742a Align copyright notice in python scripts (CVS-51320) (#4974)
* Align copyright notice in python scripts (CVS-51320)
2021-03-26 17:54:28 +03:00

26 lines
909 B
Python

# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
def factor_update(factor: float, real_factor: list, in_shape: list, out_shape: list, name: str):
""" Updates factor value for layers related to image resizing such as Resample and Interp. """
if factor is None:
if real_factor[0] != real_factor[1]:
log.warning(
'Cannot deduce a single zoom factor for both height and widths for node {}: [{},{}]/[{},{}] = [{},{}]. '
'This model will not reshape in IE.'.format(
name,
out_shape[0],
out_shape[1],
in_shape[0],
in_shape[1],
real_factor[0],
real_factor[1]
)
)
else:
factor = real_factor[0]
return factor