FrozenGene commented on a change in pull request #4816: [TFLite] Using real 
image for QNN testing.
URL: https://github.com/apache/incubator-tvm/pull/4816#discussion_r375318538
 
 

 ##########
 File path: python/tvm/relay/frontend/tflite.py
 ##########
 @@ -1124,10 +1124,14 @@ def convert_conv(self, op, conv_type):
             pad_left, pad_right = get_pad_value(input_w, dilated_kernel_w, 
stride_w)
             do_pad = not (pad_top == 0 and pad_bottom == 0 and pad_left == 0 
and pad_right == 0)
             if do_pad:
+                pad_value = 0
+                if input_tensor.qnn_params:
+                    pad_value = 
get_scalar_from_constant(input_tensor.qnn_params['zero_point'])
                 in_expr = _op.nn.pad(data=in_expr, pad_width=((0, 0),
                                                               (pad_top, 
pad_bottom),
                                                               (pad_left, 
pad_right),
-                                                              (0, 0)))
+                                                              (0, 0)), 
pad_value=float(pad_value))
 
 Review comment:
   Our convert_pad is not correct too for QNN. We should use OutputZeroPoint 
for pad_value, please fix it together and write one unit testing for it.

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