MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / pytorch_worker_seed

Function pytorch_worker_seed

SwissArmyTransformer/sat/data_utils/webds.py:48–51  ·  view source on GitHub ↗

Compute a distinct, deterministic RNG seed for each worker and node.

(group=None)

Source from the content-addressed store, hash-verified

46
47
48def pytorch_worker_seed(group=None):
49 """Compute a distinct, deterministic RNG seed for each worker and node."""
50 rank, world_size, worker, num_workers = pytorch_worker_info(group=group)
51 return rank * 1000 + worker
52
53def worker_seed_sat(group=None, seed=0):
54 return pytorch_worker_seed(group=group) + seed * 23

Callers 1

worker_seed_satFunction · 0.70

Calls 1

pytorch_worker_infoFunction · 0.70

Tested by

no test coverage detected