larroy commented on a change in pull request #11148: [MXNET-679] Refactor 
handling BLAS libraries with cmake
URL: https://github.com/apache/incubator-mxnet/pull/11148#discussion_r232294727
 
 

 ##########
 File path: tests/cpp/include/test_ndarray_utils.h
 ##########
 @@ -47,16 +49,13 @@ inline void CheckDataRegion(const TBlob &src, const TBlob 
&dst) {
   EXPECT_EQ(equals, 0);
 }
 
-inline unsigned gen_rand_seed() {
-  time_t timer;
-  ::time(&timer);
-  return static_cast<unsigned>(timer);
-}
-
 inline float RandFloat() {
-  static unsigned seed = gen_rand_seed();
-  double v = rand_r(&seed) * 1.0 / RAND_MAX;
-  return static_cast<float>(v);
+  static thread_local std::random_device device;
 
 Review comment:
   This PR is getting huge, I don't understand all the different changes and 
how the relate to one another. I very much would like to have the CMake changes 
merged, I think it would help you and reviewers if you could break down the 
changes in smaller, more manageable independent changes. Otherwise please add 
notes on why is best that the changes go together.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to