lebeg commented on a change in pull request #12356: [MXNET-860] Use modernized 
ranged loops where possible
URL: https://github.com/apache/incubator-mxnet/pull/12356#discussion_r222134743
 
 

 ##########
 File path: src/common/exec_utils.h
 ##########
 @@ -594,11 +594,11 @@ inline nnvm::Graph AssignContext(nnvm::Graph g,
   const auto& assigned_device = g.GetAttr<nnvm::DeviceVector>("device");
 
   exec::ContextVector vcontext;
-  for (size_t i = 0; i < assigned_device.size(); ++i) {
-    if (assigned_device[i] == -1) {
+  for (int context : assigned_device) {
 
 Review comment:
   Why you need the type explicitly?

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


With regards,
Apache Git Services

Reply via email to