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_r363581054
##########
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;
}
+/*
+ * \brief Checks and assigns types to scale and zero points.
+ * \param expr_type The type of expr to be checked.
+ * \param dtype The expected dtype.
+ * \param shape The shape at C dim of original tensor.
+ * \param reporter The type reported of original InferType call.
+ */
+static inline void AssignQnnParamType(const Type& expr_type, const DataType&
dtype,
Review comment:
Suggesting not naming like this, maybe no `QnnParam` words. To me, function
naming could be *what the function does* rather than *how the function is used
sometime*.
----------------------------------------------------------------
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