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

 ##########
 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:
   If there is a need to improve quantized logistic performance, introducing a 
qnn.logistic sounds reasonable and then lowering it as part of the legalize_qnn 
pass would be what I would do: However that in my mind is the next step in 
terms of improving the performance for logistic , the first step on the other 
hand to make this work and the dequantize , operation, quantize is a good way 
of making progress.

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