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.


seed – The number to seed libraries and data workers with.


train.torch.enable_reproducibility() can’t guarantee completely reproducible results across executions. To learn more, read the PyTorch notes on randomness.

PublicAPI (beta): This API is in beta and may change before becoming stable.