icemelon9 commented on a change in pull request #4644: [Relay][AutoTVM] Relay
op strategy
URL: https://github.com/apache/incubator-tvm/pull/4644#discussion_r380295907
##########
File path: src/relay/op/nn/convolution.h
##########
@@ -153,6 +153,16 @@ bool Conv2DRel(const Array<Type>& types, int num_inputs,
const Attrs& attrs,
<< " But got " << out_layout;
Array<IndexExpr> dshape_nchw = trans_in_layout.ForwardShape(data->shape);
+ bool is_depthwise = false;
+ if (param->groups > 1) {
+ CHECK(weight && weight->shape.defined()) <<
+ "Weight shape must be specified when groups is greater than 1.";
+ Array<IndexExpr> wshape_oihw =
trans_kernel_layout.ForwardShape(weight->shape);
+ if (tvm::tir::Equal(param->groups, dshape_nchw[1]) &&
+ tvm::tir::Equal(param->groups, wshape_oihw[0])) {
Review comment:
In depthwise conv2d, weight's out_channel == groups == input's in_channel,
and weight's in_channel == channel multiplier. The output's channel = groups *
channel multiplier.
----------------------------------------------------------------
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