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_r398784846
##########
File path: src/relay/qnn/op/mul.cc
##########
@@ -42,22 +42,10 @@ namespace qnn {
Expr QnnMulCanonicalize(const Attrs& attrs, const Array<Expr>& new_args,
const Array<tvm::relay::Type>& arg_types) {
// Get the attrs.
- CHECK_EQ(new_args.size(), 8);
- auto& lhs = new_args[0];
- auto& rhs = new_args[1];
- auto& lhs_scale = new_args[2];
- auto& lhs_zero_point = new_args[3];
- auto& rhs_scale = new_args[4];
- auto& rhs_zero_point = new_args[5];
- auto& output_scale = new_args[6];
- auto& output_zero_point = new_args[7];
+ QnnBinaryOpArguments args(new_args);
// Get the input dtype and shape.
- CHECK_EQ(arg_types.size(), 9);
- auto tensor_type = arg_types[0].as<TensorTypeNode>();
- CHECK(tensor_type != nullptr);
- auto input_dtype = tensor_type->dtype;
- auto input_shape = tensor_type->shape;
+ QnnBinaryOpDtypeAndShape inputShapeAndDtype(arg_types);
Review comment:
s/QnnBinaryOpDtypeAndShape/QnnBinaryType
s/inputShapeAndDtype/input_types (need to use _ for variable names)
In Relay Type means (dtype, shape)
----------------------------------------------------------------
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