MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / GetRandomSeed

Function GetRandomSeed

paddle/phi/core/generator.cc:27–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25#include "paddle/phi/core/enforce.h"
26
27static uint64_t GetRandomSeed() {
28 std::random_device rd;
29 // double has 53 bit significant, so limit uint64 to 53 bits
30 return ((((uint64_t)rd()) << 32) + rd()) & 0x1FFFFFFFFFFFFF;
31}
32
33namespace phi {
34

Callers 3

generator.ccFile · 0.85
GeneratorMethod · 0.85
SeedMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected