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

Function GetXLARandomSeed

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

Source from the content-addressed store, hash-verified

64}
65
66uint32 GetXLARandomSeed() {
67 // We initialize counter with an odd number and increment it by two
68 // everytime. This ensures that it will never be zero, even
69 // after an overflow. When seeded with zero, some XLA backends
70 // can return all zeros instead of random numbers.
71 static std::atomic<uint32> counter(InitialRandomSeed());
72 return counter.fetch_add(2);
73}
74
75xla::StatusOr<InputBuffers> GetInputBuffers(
76 XRTMemoryManager::WorkingSet* working_set, xla::Backend* backend,

Callers 1

DoWorkMethod · 0.70

Calls 1

InitialRandomSeedFunction · 0.70

Tested by

no test coverage detected