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

Function seed_everything

StyleGAN/utils.py:80–88  ·  view source on GitHub ↗
(seed=42)

Source from the content-addressed store, hash-verified

78
79
80def seed_everything(seed=42):
81 os.environ['PYTHONHASHSEED'] = str(seed)
82 random.seed(seed)
83 np.random.seed(seed)
84 torch.manual_seed(seed)
85 torch.cuda.manual_seed(seed)
86 torch.cuda.manual_seed_all(seed)
87 torch.backends.cudnn.deterministic = True
88 torch.backends.cudnn.benchmark = False
89
90
91class EMA:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected