You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by jx...@apache.org on 2017/11/07 05:21:22 UTC

[incubator-mxnet] branch master updated: Fix unused var warning in release build (only used in assert on debug builds) (#8561)

This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new cf2545f  Fix unused var warning in release build (only used in assert on debug builds) (#8561)
cf2545f is described below

commit cf2545f0d64a90a137f92f1d02b47972ea28f5e1
Author: Chris Olivier <cj...@gmail.com>
AuthorDate: Mon Nov 6 21:21:19 2017 -0800

    Fix unused var warning in release build (only used in assert on debug builds) (#8561)
---
 src/operator/roi_pooling.cc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/operator/roi_pooling.cc b/src/operator/roi_pooling.cc
index 9af00bb..a7bd608 100644
--- a/src/operator/roi_pooling.cc
+++ b/src/operator/roi_pooling.cc
@@ -52,7 +52,6 @@ inline void ROIPoolForward(const Tensor<cpu, 4, Dtype> &out,
   const int pooled_width_ = out.size(3);
 
   const int num_rois = bbox.size(0);
-  const int batch_size = data.size(0);
   const int data_size = data.size(1) * data.size(2) * data.size(3);
   // For each ROI R = [batch_index x1 y1 x2 y2]: max pool over R
   for (int n = 0; n < num_rois; ++n) {
@@ -62,7 +61,7 @@ inline void ROIPoolForward(const Tensor<cpu, 4, Dtype> &out,
     int roi_end_w = round(bottom_rois[3] * spatial_scale_);
     int roi_end_h = round(bottom_rois[4] * spatial_scale_);
     assert(roi_batch_ind >= 0);
-    assert(roi_batch_ind < batch_size);
+    assert(roi_batch_ind < data.size(0) /* batch size */);
 
     // force malformed ROIs to be 1 * 1
     int roi_height = max(roi_end_h - roi_start_h + 1, 1);

-- 
To stop receiving notification emails like this one, please contact
['"commits@mxnet.apache.org" <co...@mxnet.apache.org>'].