MCPcopy Create free account
hub / github.com/alinlab/SelfPatch / fix_random_seeds

Function fix_random_seeds

utils.py:195–201  ·  view source on GitHub ↗

Fix random seeds.

(seed=31)

Source from the content-addressed store, hash-verified

193
194
195def fix_random_seeds(seed=31):
196 """
197 Fix random seeds.
198 """
199 torch.manual_seed(seed)
200 torch.cuda.manual_seed_all(seed)
201 np.random.seed(seed)
202
203
204class SmoothedValue(object):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected