You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/12/07 05:34:29 UTC

[GitHub] TaoLv commented on a change in pull request #13530: Integrate MKLDNN Conv1d and support 3d layout

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_r239697709
 
 

 ##########
 File path: src/operator/nn/mkldnn/mkldnn_base-inl.h
 ##########
 @@ -253,14 +254,23 @@ inline static mkldnn::memory::desc GetWeightDesc(const NDArray &arr,
   if (num_groups == 1) {
     return GetMemDesc(arr);
   } else {
-    CHECK_EQ(arr.shape().ndim(), 4U);
-    mkldnn::memory::dims tz = mkldnn::memory::dims{ num_groups,
-      static_cast<int>(arr.shape()[0] / num_groups),
-      static_cast<int>(arr.shape()[1]),
-      static_cast<int>(arr.shape()[2]),
-      static_cast<int>(arr.shape()[3])};
-    return mkldnn::memory::desc{tz, get_mkldnn_type(arr.dtype()),
-                                mkldnn::memory::format::any};
+    CHECK((arr.shape().ndim() == 3) || (arr.shape().ndim() == 4));
+    if (arr.shape().ndim() == 3) {
+      mkldnn::memory::dims tz = mkldnn::memory::dims{ num_groups,
+        static_cast<int>(arr.shape()[0] / num_groups),
 
 Review comment:
   use N, C, H, W instead of 0, 1, 2, 3.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services