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

Function seed_everything

ProGAN/utils.py:76–84  ·  view source on GitHub ↗
(seed=42)

Source from the content-addressed store, hash-verified

74 param_group["lr"] = lr
75
76def seed_everything(seed=42):
77 os.environ['PYTHONHASHSEED'] = str(seed)
78 random.seed(seed)
79 np.random.seed(seed)
80 torch.manual_seed(seed)
81 torch.cuda.manual_seed(seed)
82 torch.cuda.manual_seed_all(seed)
83 torch.backends.cudnn.deterministic = True
84 torch.backends.cudnn.benchmark = False
85
86def generate_examples(gen, steps, truncation=0.7, n=100):
87 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected