tensorflow/lite/kernels/random_ops.cc
// Initialize the OpData based on the seed and seed2 values.
Initialize the OpData based on the seed and seed2 values.
Initialize the OpData based on the seed and seed2 values .
void InitializeOpData(TfLiteNode* node) {
  static std::mt19937_64* seed_generator = []() {
    std::random_device device("/dev/urandom");
    return new std::mt19937_64(device());
  }();
  auto* params = static_cast<TfLiteRandomParams*>(node->builtin_data);
  OpData* data = reinterpret_cast<OpData*>(node->user_data);
  int64_t seed = params->seed;
  int64_t seed2 = params->seed2;
  if (seed == 0 && seed2 == 0) {
    seed = (*seed_generator)();
    seed2 = (*seed_generator)();
  }
  Generator rng(seed, seed2);
  data->rng = rng;
}
void InitializeOpData ( TfLiteNode * node ) { static std :: mt19937_64 * seed_generator = [ ] ( ) { std :: random_device device ( " " ) ; return new std :: mt19937_64 ( device ( ) ) ; } ( ) ; auto * params = static_cast < TfLiteRandomParams * > ( node -> builtin_data ) ; OpData * data = reinterpret_cast < OpData * > ( node -> user_data ) ; int64_t seed = params -> seed ; int64_t seed2 = params -> seed2 ; if ( seed == 0 && seed2 == 0 ) { seed = ( * seed_generator ) ( ) ; seed2 = ( * seed_generator ) ( ) ; } Generator rng ( seed , seed2 ) ; data -> rng = rng ; }
Initialize the OpData based on the seed and seed2 values.
Initialize the OpData based on the seed and seed2 values .
// If both seeds are unspecified, generate non-deterministic random numbers.