MCPcopy Create free account
hub / github.com/KeepTryingTo/Pytorch-GAN / seed_everthing

Function seed_everthing

Code/utils.py:32–40  ·  view source on GitHub ↗
(seed = 42)

Source from the content-addressed store, hash-verified

30 param_group["lr"] = lr
31
32def seed_everthing(seed = 42):
33 os.environ["PYTHONHASHSEED"] = str(seed)
34 random.seed(seed)
35 np.random.seed(seed)
36 torch.manual_seed(seed)
37 torch.cuda.manual_seed(seed)
38 torch.cuda.manual_seed_all(seed)
39 torch.backends.cudnn.deterministic=True
40 torch.backends.cudnn.benchmark=False
41
42
43

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected