MCPcopy Create free account
hub / github.com/FoundationVision/ByteTrack / shared_random_seed

Function shared_random_seed

yolox/utils/dist.py:238–248  ·  view source on GitHub ↗

Returns: int: a random number that is the same across all workers. If workers need a shared RNG, they can use this shared seed to create one. All workers must call this function, otherwise it will deadlock.

()

Source from the content-addressed store, hash-verified

236
237
238def shared_random_seed():
239 """
240 Returns:
241 int: a random number that is the same across all workers.
242 If workers need a shared RNG, they can use this shared seed to
243 create one.
244 All workers must call this function, otherwise it will deadlock.
245 """
246 ints = np.random.randint(2 ** 31)
247 all_ints = all_gather(ints)
248 return all_ints[0]
249
250
251def time_synchronized():

Callers

nothing calls this directly

Calls 1

all_gatherFunction · 0.85

Tested by

no test coverage detected