delu.random.seed¶
- delu.random.seed(base_seed, one_cuda_seed=False)[source]¶
Set seeds in
random
,numpy
andtorch
.For all libraries, different seeds (which are _deterministically_ calculated based on the
base_seed
argument) are set.Note
Different seed are set to avoid situations where different libraries or devices generate the same random sequences. For example, see this comment on setting the same seed for the standard library and NumPy.
- Parameters
- Raises
AssertionError – if the seed is not within the required interval
- Return type
Examples
delu.random.seed(0)