From 206f9c898a6bd7ba11435717a7c47be2b9be8f61 Mon Sep 17 00:00:00 2001 From: Sergey Lyalin Date: Thu, 17 Aug 2023 01:15:35 +0400 Subject: [PATCH] Minor changes in code --- .../common_optimizations/compress_float_constants.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/transformations/src/transformations/common_optimizations/compress_float_constants.cpp b/src/common/transformations/src/transformations/common_optimizations/compress_float_constants.cpp index 10f9821d2a480d..8cf7988e98e808 100644 --- a/src/common/transformations/src/transformations/common_optimizations/compress_float_constants.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/compress_float_constants.cpp @@ -47,8 +47,8 @@ std::shared_ptr change_constant_precision_to_fp16(std::shared_ptr(num_out_of_range) / static_cast(size); + const float keep_threshold = 0.75f; + const float out_of_range_proportion = static_cast(num_out_of_range) / static_cast(size); if (out_of_range_proportion >= keep_threshold) { return nullptr; @@ -99,8 +99,8 @@ ov::pass::CompressFloatConstantsImpl::CompressFloatConstantsImpl(bool postponed) ngraph::runtime::reference::count_out_of_f16_range(const_node->get_data_ptr(), size); // if more than 75% of a FP32 constant do not fit into FP16 keep in FP32 - float keep_threshold = 0.75f; - float out_of_range_proportion = static_cast(num_out_of_range) / static_cast(size); + const float keep_threshold = 0.75f; + const float out_of_range_proportion = static_cast(num_out_of_range) / static_cast(size); if (out_of_range_proportion >= keep_threshold) return false;