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/01 17:25:18 UTC

[incubator-mxnet] branch master updated: Getting read of maybe_uninitialized warnings (#8318)

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 467a008  Getting read of maybe_uninitialized warnings (#8318)
467a008 is described below

commit 467a00835f88e62056cdbf93f4cd6fc6033c8ab3
Author: Przemyslaw Tredak <pt...@gmail.com>
AuthorDate: Wed Nov 1 10:25:10 2017 -0700

    Getting read of maybe_uninitialized warnings (#8318)
---
 src/io/iter_image_recordio_2.cc | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/io/iter_image_recordio_2.cc b/src/io/iter_image_recordio_2.cc
index e9acac8..ad53b80 100644
--- a/src/io/iter_image_recordio_2.cc
+++ b/src/io/iter_image_recordio_2.cc
@@ -357,9 +357,9 @@ template<int n_channels>
 void ImageRecordIOParser2<DType>::ProcessImage(const cv::Mat& res,
   mshadow::Tensor<cpu, 3, DType>* data_ptr, const bool is_mirrored, const float contrast_scaled,
   const float illumination_scaled) {
-  float RGBA_MULT[4];
-  float RGBA_BIAS[4];
-  float RGBA_MEAN[4];
+  float RGBA_MULT[4] = { 0 };
+  float RGBA_BIAS[4] = { 0 };
+  float RGBA_MEAN[4] = { 0 };
   mshadow::Tensor<cpu, 3, DType>& data = (*data_ptr);
   if (!std::is_same<DType, uint8_t>::value) {
     RGBA_MULT[0] = contrast_scaled / normalize_param_.std_r;
@@ -555,8 +555,8 @@ inline unsigned ImageRecordIOParser2<DType>::ParseChunk(DType* data_dptr, real_t
       std::bernoulli_distribution coin_flip(0.5);
       bool is_mirrored = (normalize_param_.rand_mirror && coin_flip(*(prnds_[tid])))
                          || normalize_param_.mirror;
-      float contrast_scaled;
-      float illumination_scaled;
+      float contrast_scaled = 1;
+      float illumination_scaled = 0;
       if (!std::is_same<DType, uint8_t>::value) {
         contrast_scaled =
           (rand_uniform(*(prnds_[tid])) * normalize_param_.max_random_contrast * 2

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