AndrewZhaoLuo commented on code in PR #10880:
URL: https://github.com/apache/tvm/pull/10880#discussion_r841956651
##########
src/relay/qnn/op/dequantize.cc:
##########
@@ -65,8 +65,9 @@ bool DequantizeRel(const Array<Type>& types, int num_inputs,
const Attrs& attrs,
ICHECK_GE(axis, 0) << "axis " << dequantize_attrs->axis << " is out of
range";
}
+ // We assume per-channel dequantization if rank > 1, otherwise it's per
tensor.
PrimExpr axis_shape;
- if (rank > 0) {
+ if ((!(scale_is_scalar && zp_is_scalar)) && (rank > 1)) {
Review Comment:
Hmm I believe we can still have per channel quantization if rank == 1. In
this case it would just be every element has it's own set of quantization
params.
I think the proper check is to change `*_is_scalar` variables to see if
either the rank of `scale` or `zp` is either of rank 0, or of arbitrary rank
but with one element.
--
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]