MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / get_rng_seed

Function get_rng_seed

smallthinker/src/llama-sampling.cpp:305–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303}
304
305static uint32_t get_rng_seed(uint32_t seed) {
306 if (seed == LLAMA_DEFAULT_SEED) {
307 // use system clock if std::random_device is not a true RNG
308 static bool is_rd_prng = std::random_device().entropy() == 0;
309 if (is_rd_prng) {
310 return (uint32_t) std::chrono::system_clock::now().time_since_epoch().count();
311 }
312 std::random_device rd;
313 return rd();
314 }
315 return seed;
316}
317
318// llama_sampler API
319

Calls 1

countMethod · 0.45

Tested by

no test coverage detected