TaoLv commented on a change in pull request #10666: [MXNET-359] fix checks on 
convolution parameters in MKLDNN.
URL: https://github.com/apache/incubator-mxnet/pull/10666#discussion_r183926258
 
 

 ##########
 File path: src/operator/nn/mkldnn/mkldnn_deconvolution.cc
 ##########
 @@ -67,31 +73,18 @@ static mkldnn::convolution_backward_data::primitive_desc 
GetDeconvFwdImpl(
   auto weight_md = GetWeightDesc(weights, param.num_group);
   auto out_md = GetMemDesc(output);
   auto engine = CpuEngine::Get()->get_engine();
+  CHECK_GE(param.stride.ndim(), 2U);
+  CHECK_GE(param.pad.ndim(), 2U);
+  CHECK_GE(param.dilate.ndim(), 2U);
   mkldnn::memory::dims strides{0, 0};
-  if (param.stride.ndim() == 2) {
-    strides[0] = param.stride[0];
-    strides[1] = param.stride[1];
-  } else if (param.stride.ndim() == 1) {
-    strides[0] = param.stride[0];
 
 Review comment:
   Python will extend one element to two-element tuple. What about other 
frontend languages or what about someone calling c APIs to build their model?

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

Reply via email to