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 computed based on the
base_seed
argument) are set (see the note below).- Parameters:
- Raises:
AssertionError – if the seed is not within the required interval
- Return type:
None
Note
Different seeds are set to avoid situations where different libraries or devices generate the same random sequences. See this comment for details.
Examples
delu.random.seed(0)