FrozenGene commented on a change in pull request #4384: [ARM CPU] Fix infer 
shape error of depthwise
URL: https://github.com/apache/incubator-tvm/pull/4384#discussion_r351068901
 
 

 ##########
 File path: python/tvm/relay/op/nn/_nn.py
 ##########
 @@ -163,10 +163,17 @@ def compute_conv2d(attrs, inputs, out_type, target):
 
     def _get_out_depth():
         weight_shape = get_const_tuple(inputs[1].shape)
+        # NHWC layout
         if kernel_layout.startswith("HW"):
             return weight_shape[2] * weight_shape[3]
-        return weight_shape[0] * weight_shape[1]
-
+        # NCHW layout.
 
 Review comment:
   @tmoreau89 I think we shouldn't need do this check. Because this is a 
utility function and layout check is done before calling it. 
https://github.com/apache/incubator-tvm/blob/d900cd67f046640e39f2b4fcd9d9a7a18d7f7f3a/python/tvm/relay/op/nn/_nn.py#L181-L184

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