Skip to content

Commit 8d31298

Browse files
committed
add conv depthwise layer
1 parent 8d38a4b commit 8d31298

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/caffe/layers/base_conv_layer.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,14 @@ void BaseConvolutionLayer<Dtype>::LayerSetUpInternal(LayerParam conv_param,
197197
CHECK_GT(num_output_, 0);
198198
//group_ = this->layer_param_.convolution_param().group();
199199
group_ = conv_param.group();
200+
//<-- depthwise convolution layer
201+
if(!strcmp(this->type(), "ConvolutionDepthwise")){
202+
if(group_ != channels_){
203+
LOG(INFO) << "DW_conv: group_(="<<group_<<") is set to be channels_(="<<channels_<<")";
204+
group_ = channels_;
205+
}
206+
}
207+
//--> depthwise convolution layer
200208
CHECK_EQ(channels_ % group_, 0);
201209
CHECK_EQ(num_output_ % group_, 0)
202210
<< "Number of output should be multiples of group.";

0 commit comments

Comments
 (0)