MCPcopy Create free account
hub / github.com/Kitware/COAT / set_random_seed

Function set_random_seed

utils/utils.py:428–436  ·  view source on GitHub ↗
(seed)

Source from the content-addressed store, hash-verified

426
427
428def set_random_seed(seed):
429 torch.manual_seed(seed)
430 torch.cuda.manual_seed(seed)
431 torch.cuda.manual_seed_all(seed)
432 torch.backends.cudnn.benchmark = False
433 torch.backends.cudnn.deterministic = True
434 random.seed(seed)
435 np.random.seed(seed)
436 os.environ["PYTHONHASHSEED"] = str(seed)

Callers 1

mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected