ray.train.torch.enable_reproducibility#
- ray.train.torch.enable_reproducibility(seed: int = 0) None [source]#
Limits sources of nondeterministic behavior.
This function:
Seeds PyTorch, Python, and NumPy.
Disables CUDA convolution benchmarking.
Configures PyTorch to use determinstic algorithms.
Seeds workers spawned for multi-process data loading.
- Parameters:
seed – The number to seed libraries and data workers with.
Warning
train.torch.enable_reproducibility()
can’t guarantee completely reproducible results across executions. To learn more, read the PyTorch notes on randomness.