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

 ##########
 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:
   Can you give more hint on why adding an abs function fixed the flakiness of 
the test?

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