lebeg commented on a change in pull request #11742: [MXNET-623][WIP] Fixing an 
integer overflow bug in large NDArray
URL: https://github.com/apache/incubator-mxnet/pull/11742#discussion_r216941335
 
 

 ##########
 File path: src/c_api/c_api_function.cc
 ##########
 @@ -56,7 +56,7 @@ std::vector<nnvm::NodeEntry> Gradient(
 
   std::vector<nnvm::NodeEntry> ret;
   for (index_t i = 0; i < g->num_outputs(); ++i) {
-    ret.emplace_back(nnvm::NodeEntry{g, i, 0});
+    ret.emplace_back(nnvm::NodeEntry{g, static_cast<uint32_t>(i), 0});
 
 Review comment:
   For large values of `i` this cast would fail, right? Probably another change 
in nnvm is needed to use `index_t` for the index: 
[node.h](https://github.com/dmlc/nnvm/blob/ef0ab9b09dbf1318851be311d3752de6c9bd4881/include/nnvm/node.h#L35)

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to