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/11/15 03:08:33 UTC

[GitHub] pengzhao-intel commented on a change in pull request #13276: enabling test_dropout after fixing flaky issue

pengzhao-intel commented on a change in pull request #13276: enabling test_dropout after fixing flaky issue
URL: https://github.com/apache/incubator-mxnet/pull/13276#discussion_r233699266
 
 

 ##########
 File path: src/operator/nn/dropout-inl.h
 ##########
 @@ -82,7 +82,7 @@ class DropoutOp {
   static void BernoulliGenerate(common::random::RandGenerator<cpu, DType> gen,
                                 int n, double p, int* r) {
     typename RandGenerator<xpu, DType>::Impl genImpl(&gen, 1);
-    const int seed = 17 + genImpl.rand() % 4096;  // NOLINT(runtime/threadsafe_fn)
+    const int seed = 17 + abs(genImpl.rand() % 4096);
     const int nthr = engine::OpenMP::Get()->GetRecommendedOMPThreadCount();
 #pragma omp parallel num_threads(nthr)
 
 Review comment:
   I think it will be better to change this parallel approach to "#pragma omp paralle for" so it will be more readable than OMP section parallel.
   Do you mind to change it? 

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