MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / InitialRandomSeed

Function InitialRandomSeed

tensorflow/compiler/xrt/kernels/xrt_execute_op.cc:52–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50};
51
52uint32 InitialRandomSeed() {
53 // Support plumbing the TF seed through to XLA is being worked on.
54 // If a user wants deterministic behavior, their best option
55 // is to start with a known checkpoint. This also handles issues when
56 // multiple random calls can be invoked in any order by TF executor.
57 // Another option is to use stateless random ops. They have much cleaner
58 // semantics.
59 // If a user really wants to set a deterministic seed for XLA-based
60 // devices, this is the place to do it.
61 std::random_device rd;
62 // Make the starting value odd.
63 return rd() | 1;
64}
65
66uint32 GetXLARandomSeed() {
67 // We initialize counter with an odd number and increment it by two

Callers 1

GetXLARandomSeedFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected