Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
anijain2305 committed Oct 21, 2020
1 parent 6b91a6b commit da11098
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/relay/qnn/op/requantize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ Expr RequantizeLower(const Expr& input_tensor, const Expr& input_scale,
const bool is_upward_rounding = (param->rounding == "UPWARD");

if (is_upward_rounding && fixed_point_multiplier == (1 << 30)) {
// Power of 2
// Power of 2 is determined by the fixed_point_multiplier == 1 << 30. In case of power of 2,
// fixed point multiplier will represent a float value of 0.5. In fixed point, this is
// represented by 1 << 30.
scaled_int32_t = PowerOfTwoMultiply(scaled_int32_t, shift - 1);
} else {
// When using upward rounding (i.e., x.5 rounded to x+1), leverage
Expand Down

0 comments on commit da11098

Please sign in to comment.