You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/11/22 13:26:26 UTC

[GitHub] [tvm] ibsidorenko commented on a diff in pull request #13469: [QNN] support zero points as variable scalar for QnnBatchMatMul op

ibsidorenko commented on code in PR #13469:
URL: https://github.com/apache/tvm/pull/13469#discussion_r1029324848


##########
src/relay/qnn/op/batch_matmul.cc:
##########
@@ -96,20 +96,42 @@ Expr BatchMatmulFirstTerm(const Expr& quantized_x, const Expr& quantized_y,
 }
 
 Expr BatchMatmulSecondTerm(const Expr& x_quantized_data, const Expr& y_zero_point) {
-  Array<Integer> axes = {2};
-  return Multiply(y_zero_point, Sum(Cast(x_quantized_data, DataType::Int(32)), axes, true, false));
+  if (IsScalar(y_zero_point)) {

Review Comment:
   ```suggestion
     ICHECK(IsScalar(y_zero_point)) << "Tensor ZP is not supported"
   ```
   Do you think return empty Expr() is better choice? I am afraid it will be not clear the reason of fail when not scalar ZP will be provided.



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org