mxnet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] eric-haibin-lin commented on a change in pull request #13896: Cudnn dropout
Date Fri, 01 Feb 2019 07:21:28 GMT
eric-haibin-lin commented on a change in pull request #13896: Cudnn dropout
URL: https://github.com/apache/incubator-mxnet/pull/13896#discussion_r252951768
 
 

 ##########
 File path: src/executor/attach_op_resource_pass.cc
 ##########
 @@ -64,20 +64,33 @@ void AttachOpResources(
                              : fresource[op](inode.source->attrs);
       // Get the resource of temporal space.
       for (const ResourceRequest& req : reqs) {
-        if (req.type == ResourceRequest::kTempSpace) {
-          if (cached_temp.count(ctx) != 0) {
-            requested.push_back(cached_temp.at(ctx));
-          } else {
-            Resource r = ResourceManager::Get()->Request(ctx, req);
-            requested.push_back(r);
-            cached_temp[ctx] = r;
+        switch (req.type) {
+          case ResourceRequest::kTempSpace: {
+            if (cached_temp.count(ctx) != 0) {
+              requested.push_back(cached_temp.at(ctx));
+            } else {
+              Resource r = ResourceManager::Get()->Request(ctx, req);
 
 Review comment:
   Add a comment here why brackets are useful here. This is a good lesson

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

Mime
View raw message