PyTorch torch.are_deterministic_algorithms_enabled function
PyTorch torch reference manual
torch.are_deterministic_algorithms_enabled is a function in PyTorch used to check whether deterministic algorithms are enabled. Returning True means deterministic algorithms are enabled, which means each run produces the same result.
Function definition
torch.are_deterministic_algorithms_enabled()
Usage examples
Example
import
torch
Check whether deterministic algorithms are enabled
is_deterministic
=
torch.
are_deterministic_algorithms_enabled
(
)
(
f
"Deterministic algorithms enabled: {is_deterministic}"
)
Enable deterministic algorithms
torch.
use_deterministic_algorithms
(
True
)
is_deterministic
=
torch.
are_deterministic_algorithms_enabled
(
)
(
f
"After setting: {is_deterministic}"
)