FrozenGene commented on a change in pull request #4696: 
[Relay][Frontend][TFlite] Add support for quantized LOGISTIC
URL: https://github.com/apache/incubator-tvm/pull/4696#discussion_r374205954
 
 

 ##########
 File path: python/tvm/relay/frontend/tflite.py
 ##########
 @@ -384,7 +401,16 @@ def convert_logistic(self, op):
         input_tensor = input_tensors[0]
         in_expr = self.get_expr(input_tensor.tensor_idx)
 
+        output_tensors = self.get_output_tensors(op)
+        assert len(output_tensors) == 1, "output tensors length should be 1"
+        output_tensor = output_tensors[0]
+
+        if input_tensor.qnn_params:
+            in_expr = self.dequantize(in_expr, input_tensor)
         out = _op.sigmoid(in_expr)
 
 Review comment:
   I was talking about **pure integer computation of sigmoid.** That is to say, 
current computation of quantized sigmoid is float arithmetic in fact, we just 
`dequantize` to float, `float arithmetic`, `requantize` to quantized UINT8 
type. However, like TFLite, we have **pure integer computation of sigmoid.** 
like this : 
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/kernels/internal/reference/integer_ops/logistic.h#L24,
 which is I checked just now. It seems a little complicated. So maybe we use 
current way is an acceptable way.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to