You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/08/29 06:44:39 UTC

[GitHub] [tvm] masahi commented on a diff in pull request #12624: [QNN] Align output_scale/zero_point of sigmoid to Torch

masahi commented on code in PR #12624:
URL: https://github.com/apache/tvm/pull/12624#discussion_r956947800


##########
python/tvm/relay/frontend/qnn_torch.py:
##########
@@ -571,9 +602,12 @@ def quantized_relu(data, input_zero_point):
     return _op.tensor.maximum(data, zp)
 
 
-def quantized_sigmoid(data, input_scale, input_zero_point):
-    output_scale = input_scale
-    output_zero_point = input_zero_point
+def quantized_sigmoid(inputs):
+    data = inputs[0]
+    output_scale = _expr.const(inputs[1])
+    output_zero_point = _expr.const(inputs[2])
+    input_scale = _expr.const(inputs[3])
+    input_zero_point = _expr.const(inputs[4])

Review Comment:
   Are you sure that output params occur before input? Your change seem to be calling `_add_output_quant_params_to_sigmoid_op` after we call `_get_quant_param_for_input`, which adds the input qparams first?.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org