Configure PyTorch deterministic mode.
When using the
Trainer, you can use the
deterministic_modeflag instead of invoking this function directly. For example:
>>> trainer = Trainer(deterministic_mode=True)
However, to configure deterministic mode for operations before the trainer is initialized, manually invoke this function at the beginning of your training script.
When training on a GPU, this function must be invoked before any CUDA operations.
Deterministic mode degrades performance. Do not use outside of testing and debugging.