anijain2305 commented on a change in pull request #5066: [ConvertLayout] 
Support QNN ops.
URL: https://github.com/apache/incubator-tvm/pull/5066#discussion_r393344558
 
 

 ##########
 File path: src/relay/qnn/op/convolution.cc
 ##########
 @@ -68,6 +68,23 @@ bool QnnConv2DRel(const Array<Type>& types, int num_inputs, 
const Attrs& attrs,
   return Conv2DRel<Conv2DAttrs>(tensor_types, 3, attrs, reporter);
 }
 
+Array<Array<Layout>> QnnConvInferCorrectLayout(const Attrs& attrs,
+                                               const Array<Layout>& 
new_in_layouts,
+                                               const Array<Layout>& 
old_in_layouts,
+                                               const Array<tvm::relay::Type>& 
old_in_types) {
+  // Use Relay Conv2D Infer correct layout.
+  auto layouts =
+      ConvInferCorrectLayout<Conv2DAttrs>(attrs, new_in_layouts, 
old_in_layouts, old_in_types);
+
+  // Fill the layouts of remaining input tensors - scales and zero points. The 
layouts of these
+  // tensors can be ignored as they dont go through any transformation.
+  Layout ignore_layout = Layout("I");
 
 Review comment:
   They can be scalar, or output channel. I initially thought of putting them 
as "C". But, chose "I" to be more specific. I am open to discuss.

----------------------------------------------------------------
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

Reply via email to