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/12 04:52:56 UTC

[GitHub] pengzhao-intel commented on a change in pull request #13599: fallback to dense version for grad(reshape), grad(expand_dims)

pengzhao-intel commented on a change in pull request #13599: fallback to dense version for grad(reshape), grad(expand_dims)
URL: https://github.com/apache/incubator-mxnet/pull/13599#discussion_r240881956
 
 

 ##########
 File path: src/operator/tensor/elemwise_unary_op_basic.cc
 ##########
 @@ -236,6 +236,27 @@ NNVM_REGISTER_OP(_backward_copy)
     return std::vector<bool>{true};
   });
 
+NNVM_REGISTER_OP(_backward_reshape)
+.set_num_inputs(1)
+.set_num_outputs(1)
+.set_attr<nnvm::TIsBackward>("TIsBackward", true)
+.set_attr<nnvm::FInplaceOption>("FInplaceOption",
+                                [](const NodeAttrs& attrs){
+                                  return std::vector<std::pair<int, int> >{{0, 0}};
+                                })
+.set_attr<FInferStorageType>("FInferStorageType", ElemwiseStorageType<1, 1, false, false, false>)
+.set_attr<FCompute>("FCompute<cpu>", UnaryOp::IdentityCompute<cpu>)
+#if MXNET_USE_MKLDNN == 1
+.set_attr<bool>("TIsMKLDNN", true)
+.set_attr<FResourceRequest>("FResourceRequest", [](const NodeAttrs& n) {
+  return std::vector<ResourceRequest>{ResourceRequest::kTempSpace};
+})
+#endif
 
 Review comment:
   FYI, https://github.com/apache/incubator-mxnet/pull/12980 is enabled the FW of MKL-DNN supported reshape but BW is still WIP @huangzhiyuan 

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