MCPcopy Create free account
hub / github.com/Atrovast/THGS / seed_everything

Function seed_everything

scripts/image_encoding.py:334–344  ·  view source on GitHub ↗
(seed_value)

Source from the content-addressed store, hash-verified

332 return seg_images, seg_maps
333
334def seed_everything(seed_value):
335 random.seed(seed_value)
336 np.random.seed(seed_value)
337 torch.manual_seed(seed_value)
338 os.environ['PYTHONHASHSEED'] = str(seed_value)
339
340 if torch.cuda.is_available():
341 torch.cuda.manual_seed(seed_value)
342 torch.cuda.manual_seed_all(seed_value)
343 torch.backends.cudnn.deterministic = True
344 torch.backends.cudnn.benchmark = True
345
346
347if __name__ == '__main__':

Callers 1

image_encoding.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected