Skip to content

Commit

Permalink
Fix get_seed in CXX11
Browse files Browse the repository at this point in the history
  • Loading branch information
sxjscience committed Jul 23, 2016
1 parent cfb7d23 commit 02e9eec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mshadow/random.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ class Random<cpu, DType> {
inline void Seed(int seed) {
#if MSHADOW_IN_CXX11
rnd_engine_.seed(seed);
#else
this->rseed_ = static_cast<unsigned>(seed);
#endif
this->rseed_ = static_cast<unsigned>(seed);
}
/*!
* \brief get random seed used in random generator
Expand Down Expand Up @@ -151,6 +150,8 @@ class Random<cpu, DType> {
#if MSHADOW_IN_CXX11
/*! \brief use c++11 random engine. */
std::mt19937 rnd_engine_;
/*! \brief random number seed used in random engine */
unsigned rseed_;
// implementing generators.
inline void GenUniform(DType *dptr, index_t size, DType a, DType b) {
std::uniform_real_distribution<DType> dist_uniform(a, b);
Expand Down

0 comments on commit 02e9eec

Please sign in to comment.