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 2018/10/03 11:53:33 UTC

[GitHub] KellenSunderland commented on a change in pull request #12356: [MXNET-860] Use modernized ranged loops where possible

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

 ##########
 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:
   I tend to include it in cases where it's not already obvious.

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


With regards,
Apache Git Services