apeforest commented on a change in pull request #16735: Use single-bit for mask 
in dropout operator
URL: https://github.com/apache/incubator-mxnet/pull/16735#discussion_r360782941
 
 

 ##########
 File path: src/operator/nn/dropout.cc
 ##########
 @@ -118,14 +118,18 @@ Example::
   if (!mxnet::ndim_is_known(dshape)) return false;
   out_shape->clear();
   out_shape->push_back(dshape);
-  for (int i = 0; i < param.axes.ndim(); ++i) {
-    dshape[param.axes[i]] = 1;
+  if (param.axes.ndim() > 0) {
+    for (int i = 0; i < param.axes.ndim(); ++i) {
+      dshape[param.axes[i]] = 1;
+    }
   }
-  out_shape->push_back(dshape);
+  mxnet::TShape mshape(1, 
static_cast<dim_t>(ceil(static_cast<double>(dshape.Size()) / 8)));
+  out_shape->push_back(mshape);
   return true;
 })
 .set_attr<nnvm::FInferType>("FInferType", [](const nnvm::NodeAttrs& attrs,
       std::vector<int> *in_type, std::vector<int> *out_type) {
+  using namespace mshadow;
 
 Review comment:
   will remove

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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