From da1109818296c463e20b67f3dfcc3c6b071ede05 Mon Sep 17 00:00:00 2001 From: Animesh Jain Date: Tue, 20 Oct 2020 23:58:32 +0000 Subject: [PATCH] Comments --- src/relay/qnn/op/requantize.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/relay/qnn/op/requantize.cc b/src/relay/qnn/op/requantize.cc index 3c69e8fad95f9..d9c4bf3af2fa3 100644 --- a/src/relay/qnn/op/requantize.cc +++ b/src/relay/qnn/op/requantize.cc @@ -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