access2rohit commented on a change in pull request #15960: Added more tests for 
Large Indices
URL: https://github.com/apache/incubator-mxnet/pull/15960#discussion_r319283652
 
 

 ##########
 File path: src/ndarray/ndarray_function.cc
 ##########
 @@ -38,7 +38,7 @@ void Copy<cpu, cpu>(const TBlob &from, TBlob *to,
                     RunContext ctx) {
   MSHADOW_TYPE_SWITCH(to->type_flag_, DType, {
     if (to->type_flag_ == from.type_flag_) {
-      const index_t size = from.Size();
+      const index_t size = static_cast<index_t>(from.Size());
 
 Review comment:
   Is automatic casting good practice ? I am not sure. Even google style guide 
doesn't say anything about it: 
https://google.github.io/styleguide/cppguide.html#Casting
   I my opinion explicit casting improves code readability and helps the person 
reading the code understand that `Size()` doesn't return `index_t`. @apeforest  
what do you think ?

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