anijain2305 commented on a change in pull request #5153: Adding support for QNN 
subtract op
URL: https://github.com/apache/incubator-tvm/pull/5153#discussion_r398847589
 
 

 ##########
 File path: src/relay/qnn/op/mul.cc
 ##########
 @@ -71,31 +59,35 @@ Expr QnnMulCanonicalize(const Attrs& attrs, const 
Array<Expr>& new_args,
   which is essentially a requantization of tensor Q' into tensor Q_c.
   */
 
-  auto lhs_shifted = Cast(lhs, DataType::Int(32));
-  auto rhs_shifted = Cast(rhs, DataType::Int(32));
+  auto lhs_shifted = Cast(args.lhs, fullPrecisionInt32);
 
 Review comment:
   I understand the concern. At the same time, one might want to upcast only to 
int16 and not int32 while subtracting zero points for one operator, while keep 
int32 for other (for example, in pool, even int16 upcasting is ok). Similarly, 
one might choose int64 for mul in future. So, I think it is safe to keep 
DataType::Int(32).

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


With regards,
Apache Git Services

Reply via email to