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/12/07 11:27:38 UTC

[GitHub] larroy commented on a change in pull request #13574: Replaced rand_r with std:: random generation

larroy commented on a change in pull request #13574: Replaced rand_r with std:: random generation
URL: https://github.com/apache/incubator-mxnet/pull/13574#discussion_r239776633
 
 

 ##########
 File path: src/operator/rnn_impl.h
 ##########
 @@ -1890,7 +1896,11 @@ void VanillaRNNForwardTraining(DType* ws,
     if (dropout > 0.0f && l > 0) {
       #pragma omp parallel for num_threads(omp_threads)
       for (int i = 0; i < T * N * I; i++) {
-        int rand_data = rand_r(&seed_);
+        static thread_local std::random_device device;
 
 Review comment:
   could we wrap this up in a function? Or would interfere with thread_local? Seems we are duplicating code.

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