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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to