tensorflow/lite/kernels/random_ops.cc
// Generates random numbers following a uniform distribution from the underlying
// random integer generator, which returns a uint32 array of size
// kResultElementCount on each invocation.
Generates random numbers following a uniform distribution from the underlying
random integer generator, which returns a uint32 array of size
kResultElementCount on each invocation.
Generates random numbers following a uniform distribution from the underlying random integer generator which returns a uint32 array of size kResultElementCount on each invocation .
void GenerateRandomUniformNumbers(
    Generator& rng, float* buffer, size_t buffer_size) {
  size_t current_size = 0;
  size_t rng_size = Generator::kResultElementCount;
  while (current_size < buffer_size) {
    typename Generator::ResultType samples = rng();
    const int rng_net_size = std::min(rng_size, buffer_size - current_size);
    for (int i = 0; i < rng_net_size; i++) {
      buffer[current_size + i] = tensorflow::random::Uint32ToFloat(samples[i]);
    }
    current_size += rng_net_size;
  }
}
void GenerateRandomUniformNumbers ( Generator & rng , float * buffer , size_t buffer_size ) { size_t current_size = 0 ; size_t rng_size = Generator :: kResultElementCount ; while ( current_size < buffer_size ) { typename Generator :: ResultType samples = rng ( ) ; const int rng_net_size = std :: min ( rng_size , buffer_size - current_size ) ; for ( int i = 0 ; i < rng_net_size ; i ++ ) { buffer [ current_size + i ] = tensorflow :: random :: Uint32ToFloat ( samples [ i ] ) ; } current_size += rng_net_size ; } }
Generates random numbers following a uniform distribution from the underlying
random integer generator, which returns a uint32 array of size
kResultElementCount on each invocation.
Generates random numbers following a uniform distribution from the underlying random integer generator which returns a uint32 array of size kResultElementCount on each invocation .