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/03/04 13:01:31 UTC

[GitHub] xinyu-intel commented on a change in pull request #9958: Parallelization for ROIpooling OP

xinyu-intel commented on a change in pull request #9958: Parallelization for ROIpooling OP
URL: https://github.com/apache/incubator-mxnet/pull/9958#discussion_r172048022
 
 

 ##########
 File path: src/operator/roi_pooling.cc
 ##########
 @@ -98,30 +109,26 @@ inline void ROIPoolForward(const Tensor<cpu, 4, Dtype> &out,
 
           const int pool_index = ph * pooled_width_ + pw;
           if (is_empty) {
-            top_data[pool_index] = 0;
-            argmax_data[pool_index] = -1;
+            top_data_c[pool_index] = 0;
+            argmax_data_c[pool_index] = -1;
           }
 
           for (int h = hstart; h < hend; ++h) {
             for (int w = wstart; w < wend; ++w) {
               const int index = h * width_ + w;
-              if (batch_data[index] > top_data[pool_index]) {
-                top_data[pool_index] = batch_data[index];
-                argmax_data[pool_index] = index;
+              if (batch_data_c[index] > top_data_c[pool_index]) {
+                top_data_c[pool_index] = batch_data_c[index];
+                argmax_data_c[pool_index] = index;
               }
             }
           }
         }
       }
-      // Increment all data pointers by one channel
-      batch_data += data.size(2) * data.size(3);
-      top_data += out.size(2) * out.size(3);
-      argmax_data += max_idx.size(2) * max_idx.size(3);
     }
-    // Increment ROI data pointer
-    bottom_rois += bbox.size(1);
+    // Increase data pointers by one outsize
+    top_data += channels_ * out_size_c;
 
 Review comment:
   Thanks for great comment, I've redesigned this part:)

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