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 2017/11/01 17:25:14 UTC

[GitHub] piiswrong closed pull request #8318: Getting rid of maybe_uninitialized warnings

piiswrong closed pull request #8318: Getting rid of maybe_uninitialized warnings
URL: https://github.com/apache/incubator-mxnet/pull/8318
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/io/iter_image_recordio_2.cc b/src/io/iter_image_recordio_2.cc
index e9acac83a9..ad53b80d02 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


 

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