inadob 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_r374201180
 
 

 ##########
 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:
   Well I have the following understanding for that case: since by definition 
sigmoid outputs a probability in [0, 1] in real space, then in uint8 [0, 1] 
will have a different meaning, so we should dequantize before doing the 
operation. Correct me if I'm wrong.
   Or you are talking about INT, not UINT?  

----------------------------------------------------------------
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