MCPcopy Create free account
hub / github.com/AkaliKong/MiniOneRec / set_seed

Function set_seed

evaluate.py:28–36  ·  view source on GitHub ↗
(seed)

Source from the content-addressed store, hash-verified

26 return '-'.join(x)
27
28def set_seed(seed):
29 random.seed(seed)
30 np.random.seed(seed)
31 torch.manual_seed(seed)
32 if torch.cuda.is_available():
33 torch.cuda.manual_seed(seed)
34 torch.cuda.manual_seed_all(seed) # if you are using multi-GPU.
35 # torch.backends.cudnn.deterministic = True
36 # torch.backends.cudnn.benchmark = False
37
38def main(
39 base_model: str = "",

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected