From 02049b1fecc204ee69e7ab27797261208e4716d6 Mon Sep 17 00:00:00 2001 From: Pavel Esir Date: Wed, 16 Aug 2023 14:09:08 +0200 Subject: [PATCH] minor corrections --- .../common_optimizations/compress_float_constants.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 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 5d5a6601a38de3..00de71dbc78133 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 @@ -26,10 +26,9 @@ std::shared_ptr change_constant_precision_to_fp16(std::shared_ptr(ov::element::f16, constant->get_shape()); auto* dst_data = const_cast(reinterpret_cast(new_constant->get_data_ptr())); - if (!dst_data || size == 0) + if (!dst_data || !size) return nullptr; - // TODO: Speed this part up by applying code similar to Convert::evaluate int num_out_of_range = 0; for (size_t i = 0; i < size; ++i) { // if abs value is smaller than the smallest positive fp16, but not zero @@ -90,11 +89,6 @@ ov::pass::CompressFloatConstantsImpl::CompressFloatConstantsImpl(bool postponed) } if (!new_const) // if out of range > threshold -> then new_const == nullptr return false; - - if (postponed) { // dispose converted const for postponed - new_const = const_node - } - #else if (c_type == ov::element::f32) { auto size = shape_size(const_node->get_output_shape(0));