Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhan committed Oct 9, 2024
1 parent 9696972 commit bc24d3b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ struct quantize_domain {
static float min_upper(float scale, int zp) {
int64_t codomain_min = std::numeric_limits<T>::lowest();
int64_t biased = codomain_min - zp;
float before_round = float(biased) + 0.5; // move to upperbound
if (biased % 2 == 1) { // cannot be exact ?.5 because of rounding to even
float before_round = float(biased) + 0.5f; // move to upperbound

Check warning on line 45 in onnxruntime/core/providers/qnn/builder/qnn_node_group/conv_activation_fusion.cc

View workflow job for this annotation

GitHub Actions / Optional Lint C++

[cpplint] reported by reviewdog 🐶 Using deprecated casting style. Use static_cast<float>(...) instead [readability/casting] [4] Raw Output: onnxruntime/core/providers/qnn/builder/qnn_node_group/conv_activation_fusion.cc:45: Using deprecated casting style. Use static_cast<float>(...) instead [readability/casting] [4]
if (biased % 2 == 1) { // cannot be exact ?.5 because of rounding to even
before_round = std::nextafterf(before_round, float(biased));

Check warning on line 47 in onnxruntime/core/providers/qnn/builder/qnn_node_group/conv_activation_fusion.cc

View workflow job for this annotation

GitHub Actions / Optional Lint C++

[cpplint] reported by reviewdog 🐶 Using deprecated casting style. Use static_cast<float>(...) instead [readability/casting] [4] Raw Output: onnxruntime/core/providers/qnn/builder/qnn_node_group/conv_activation_fusion.cc:47: Using deprecated casting style. Use static_cast<float>(...) instead [readability/casting] [4]
}
return before_round * scale;
Expand All @@ -52,8 +52,8 @@ struct quantize_domain {
static float max_lower(float scale, int zp) {
int64_t codomain_max = std::numeric_limits<T>::max();
int64_t biased = codomain_max - zp;
float before_round = float(biased) - 0.5; // move to lowerbound
if (biased % 2 == 1) { // cannot be exact ?.5 because of rounding to even
float before_round = float(biased) - 0.5f; // move to lowerbound

Check warning on line 55 in onnxruntime/core/providers/qnn/builder/qnn_node_group/conv_activation_fusion.cc

View workflow job for this annotation

GitHub Actions / Optional Lint C++

[cpplint] reported by reviewdog 🐶 Using deprecated casting style. Use static_cast<float>(...) instead [readability/casting] [4] Raw Output: onnxruntime/core/providers/qnn/builder/qnn_node_group/conv_activation_fusion.cc:55: Using deprecated casting style. Use static_cast<float>(...) instead [readability/casting] [4]
if (biased % 2 == 1) { // cannot be exact ?.5 because of rounding to even
before_round = std::nextafterf(before_round, float(biased));

Check warning on line 57 in onnxruntime/core/providers/qnn/builder/qnn_node_group/conv_activation_fusion.cc

View workflow job for this annotation

GitHub Actions / Optional Lint C++

[cpplint] reported by reviewdog 🐶 Using deprecated casting style. Use static_cast<float>(...) instead [readability/casting] [4] Raw Output: onnxruntime/core/providers/qnn/builder/qnn_node_group/conv_activation_fusion.cc:57: Using deprecated casting style. Use static_cast<float>(...) instead [readability/casting] [4]
}
return before_round * scale;
Expand Down

0 comments on commit bc24d3b

Please sign in to comment.