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 2020/01/07 04:57:10 UTC

[GitHub] [incubator-tvm] jackwish commented on a change in pull request #4629: [QNN] Channel wise quantization - Quantize & Requantize

jackwish commented on a change in pull request #4629: [QNN] Channel wise quantization - Quantize & Requantize
URL: https://github.com/apache/incubator-tvm/pull/4629#discussion_r363580810
 
 

 ##########
 File path: src/relay/qnn/util.h
 ##########
 @@ -132,11 +160,47 @@ Expr FixedPointMultiply(Expr tensor, double multiplier, const Array<IndexExpr>&
  */
 static inline bool IsScalarType(const Type& expr_type, const DataType& dtype) {
   const auto* scale = expr_type.as<TensorTypeNode>();
-  CHECK_EQ(scale->shape.size(), 0);
+  if (scale->shape.size() != 0) {
+    return false;
+  }
   CHECK(scale->dtype == dtype) << "Expected " << dtype << " but got " << scale->dtype;
   return true;
 }
 
 Review comment:
   I understand there is nothing too wrong here, but the `IsScalarType()` naming seems not enforce a same type here, leading to confusing logic in `AssignQnnParamType`....

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services