mxnet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] mseth10 commented on a change in pull request #13276: enabling test_dropout after fixing flaky issue
Date Thu, 15 Nov 2018 09:37:49 GMT
mseth10 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_r233770718
 
 

 ##########
 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:
   @pengzhao-intel Thanks for your feedback. I don't see why "#pragma omp parallel for" would
be more readable in this case as there is no for loop involved. The job for each thread is
defined based on its thread number. Introducing a for loop with "#pragma omp parallel for"
would be redundant. Please correct me if I've misunderstood 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

Mime
View raw message