Zha0q1 commented on a change in pull request #19301:
URL: https://github.com/apache/incubator-mxnet/pull/19301#discussion_r501954750



##########
File path: src/operator/numpy/np_matrix_op-inl.h
##########
@@ -487,12 +487,12 @@ void NumpyRollCompute(const nnvm::NodeAttrs& attrs,
   CHECK_EQ(req.size(), 1U);
   if (inputs[0].Size() == 0U) return;
   const NumpyRollParam& param = nnvm::get<NumpyRollParam>(attrs.parsed);
-  const index_t ndim(inputs[0].shape_.ndim());
+  const int ndim(inputs[0].shape_.ndim());

Review comment:
       Yes. Number of dims has always been int. Here the original author used 
index_t but there is no point in doing so. Plus I think we have a hard limit 
for any tensors to be <= 10 dims

##########
File path: src/operator/numpy/np_matrix_op-inl.h
##########
@@ -487,12 +487,12 @@ void NumpyRollCompute(const nnvm::NodeAttrs& attrs,
   CHECK_EQ(req.size(), 1U);
   if (inputs[0].Size() == 0U) return;
   const NumpyRollParam& param = nnvm::get<NumpyRollParam>(attrs.parsed);
-  const index_t ndim(inputs[0].shape_.ndim());
+  const int ndim(inputs[0].shape_.ndim());

Review comment:
       size of individual dims and total size can both be >= 2**31 when large 
tensor is on

##########
File path: src/operator/numpy/np_matrix_op-inl.h
##########
@@ -487,12 +487,12 @@ void NumpyRollCompute(const nnvm::NodeAttrs& attrs,
   CHECK_EQ(req.size(), 1U);
   if (inputs[0].Size() == 0U) return;
   const NumpyRollParam& param = nnvm::get<NumpyRollParam>(attrs.parsed);
-  const index_t ndim(inputs[0].shape_.ndim());
+  const int ndim(inputs[0].shape_.ndim());

Review comment:
       Yes. Number of dims has always been int. Here the original author used 
index_t but there is no point in doing so. Plus I think we have a hard limit 
for any tensors to be <= 10 dims in many ops




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


Reply via email to