MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / set_random_seed

Function set_random_seed

tests/test_inference_megatron.py:17–23  ·  view source on GitHub ↗
(seed)

Source from the content-addressed store, hash-verified

15
16
17def set_random_seed(seed):
18 np.random.seed(seed)
19 torch.manual_seed(seed)
20 torch.cuda.manual_seed_all(seed)
21
22 torch.backends.cudnn.deterministic = True
23 torch.backends.cudnn.benchmark = False
24
25
26def model_provider(pre_process=True, post_process=True):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected