MCPcopy Create free account
hub / github.com/AtlasAnalyticsLab/AdaFisher / seed_experiment

Function seed_experiment

Language_Model/utils/torch_utils.py:5–14  ·  view source on GitHub ↗

Seed the pseudorandom number generator, for repeatability. Args: seed (int): random seed

(seed)

Source from the content-addressed store, hash-verified

3
4
5def seed_experiment(seed):
6 """Seed the pseudorandom number generator, for repeatability.
7
8 Args:
9 seed (int): random seed
10 """
11 np.random.seed(seed)
12 torch.manual_seed(seed)
13 torch.cuda.manual_seed(seed)
14 torch.backends.cudnn.benchmark = True
15
16
17def to_device(tensors, device):

Callers 1

mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected