Pytorch Torch Set_Deterministic_Algorithm_Enabled
# PyTorch torch.set_deterministic_algorithm_enabled Function
* * *
[ Pytorch torch Reference Manual](https://example.com/pytorch/pytorch-torch-ref.html)
`torch.set_deterministic_algorithm_enabled` is a function in PyTorch used to set deterministic algorithms. It sets whether to enable deterministic algorithms; after enabling, each run will produce the same results.
### Function Definition
torch.set_deterministic_algorithm_enabled(enabled, mode='warn')
* * *
## Usage Example
## Example
import torch
# Enable deterministic algorithm
torch.set_deterministic_algorithm_enabled(True)
# Check if enabled
print(f"Is deterministic: {torch.are_deterministic_algorithms_enabled()}")
# Disable deterministic algorithm
torch.set_deterministic_algorithm_enabled(False)
print(f"Is deterministic: {torch.are_deterministic_algorithms_enabled()}")
* * *
[ Pytorch torch Reference Manual](https://example.com/pytorch/pytorch-torch-ref.html)
YouTip