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;