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 2019/10/18 18:32:10 UTC

[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15126: [MXNET-1407] Added test to verify Large Tensor Support for pad operator

access2rohit commented on a change in pull request #15126: [MXNET-1407] Added test to verify Large Tensor Support for pad operator
URL: https://github.com/apache/incubator-mxnet/pull/15126#discussion_r336623367
 
 

 ##########
 File path: src/operator/pad.cc
 ##########
 @@ -558,23 +558,23 @@ void single_image_reflect_grad(const Tensor<cpu, 4, DType> &grad_in,
                                 const Tensor<cpu, 4, DType> grad_out,
                                 mxnet::TShape pad) {
   const int nslices = grad_in.size(0);
-  const int idepth = grad_in.size(1);
-  const int iheight = grad_in.size(2);
-  const int iwidth = grad_in.size(3);
-
-  const int odepth = grad_out.size(1);
-  const int oheight = grad_out.size(2);
-  const int owidth = grad_out.size(3);
-
-  const int pad_f = pad[4];
-  const int pad_t = pad[6];
-  const int pad_l = pad[8];
-  int iStartX = std::max(0, -pad_l);
-  int iStartY = std::max(0, -pad_t);
-  int iStartZ = std::max(0, -pad_f);
-  int oStartX = std::max(0, pad_l);
-  int oStartY = std::max(0, pad_t);
-  int oStartZ = std::max(0, pad_f);
+  const index_t idepth = grad_in.size(1);
+  const index_t iheight = grad_in.size(2);
+  const index_t iwidth = grad_in.size(3);
+
+  const index_t odepth = grad_out.size(1);
+  const index_t oheight = grad_out.size(2);
+  const index_t owidth = grad_out.size(3);
+
+  const index_t pad_f = pad[4];
+  const index_t pad_t = pad[6];
+  const index_t pad_l = pad[8];
+  index_t iStartX = std::max(index_t{0}, -pad_l);
+  index_t iStartY = std::max(index_t{0}, -pad_t);
+  index_t iStartZ = std::max(index_t{0}, -pad_f);
+  index_t oStartX = std::max(index_t{0}, pad_l);
+  index_t oStartY = std::max(index_t{0}, pad_t);
+  index_t oStartZ = std::max(index_t{0}, pad_f);
 
   int l, ip_x, ip_y, ip_z;
 
 Review comment:
   good catch ... missed it. Will add it now

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


With regards,
Apache Git Services