TaoLv commented on a change in pull request #13530: Integrate MKLDNN Conv1d and
support 3d layout
URL: https://github.com/apache/incubator-mxnet/pull/13530#discussion_r240006218
##########
File path: src/operator/nn/mkldnn/mkldnn_convolution.cc
##########
@@ -113,9 +126,15 @@ mkldnn::convolution_forward::primitive_desc
GetConvFwdImpl(
}
return conv_pd;
} else {
- mkldnn::memory::dims dilates{0, 0};
- dilates[0] = param.conv_param.dilate[0] - 1;
- dilates[1] = param.conv_param.dilate[1] - 1;
+ mkldnn::memory::dims dilates(param.conv_param.kernel.ndim());
+ if (param.conv_param.dilate.ndim() == 1) {
+ dilates[0] = param.conv_param.dilate[0] - 1;
+ } else if (param.conv_param.dilate.ndim() == 2) {
+ dilates[0] = param.conv_param.dilate[0] - 1;
+ dilates[1] = param.conv_param.dilate[1] - 1;
+ } else {
+ LOG(FATAL) << "MKL-DNN currently supports 1d and 2d convolution";
Review comment:
It would be better if we can mention the given dimension in the error
message. Same in other LOG(FATAL).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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