Skip to content

Commit

Permalink
Minor changes in code
Browse files Browse the repository at this point in the history
  • Loading branch information
slyalin committed Aug 16, 2023
1 parent c8a1798 commit 206f9c8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ std::shared_ptr<ov::Node> change_constant_precision_to_fp16(std::shared_ptr<ov::
}

// 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<float>(num_out_of_range) / static_cast<float>(size);
const float keep_threshold = 0.75f;
const float out_of_range_proportion = static_cast<float>(num_out_of_range) / static_cast<float>(size);

if (out_of_range_proportion >= keep_threshold) {
return nullptr;
Expand Down Expand Up @@ -99,8 +99,8 @@ ov::pass::CompressFloatConstantsImpl::CompressFloatConstantsImpl(bool postponed)
ngraph::runtime::reference::count_out_of_f16_range(const_node->get_data_ptr<ov::element::f32>(), 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<float>(num_out_of_range) / static_cast<float>(size);
const float keep_threshold = 0.75f;
const float out_of_range_proportion = static_cast<float>(num_out_of_range) / static_cast<float>(size);
if (out_of_range_proportion >= keep_threshold)
return false;

Expand Down

0 comments on commit 206f9c8

Please sign in to comment.