peal.global_utils.set_random_seed

peal.global_utils.set_random_seed(seed)[source]

Seed every random source PEAL uses and force deterministic cuDNN.

Seeds random, numpy, torch on CPU and on all GPUs, sets PYTHONHASHSEED and switches cuDNN to deterministic mode with benchmarking off, which costs some speed but makes runs comparable.

Parameters:

seed (int) – The seed to use.