AndrewZhaoLuo commented on code in PR #10952:
URL: https://github.com/apache/tvm/pull/10952#discussion_r852476788
##########
python/tvm/relay/qnn/op/legalizations.py:
##########
@@ -92,12 +92,30 @@ def qnn_conv2d_transpose_legalize(attrs, inputs, types):
# Collect the input exprs.
data, kernel, input_zero_point, kernel_zero_point, _, _ = inputs
- shift_data = relay.subtract(
- relay.cast(data, dtype="int16"), relay.cast(input_zero_point, "int16")
- )
- shift_kernel = relay.subtract(
- relay.cast(kernel, dtype="int16"), relay.cast(kernel_zero_point,
"int16")
- )
+ # If input zero point is a scalar, we can directly subtract it.
+ if len(types[2].shape) == 0:
Review Comment:
Do you need bias add for the else branch or can you use it in both cases?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]