PyTorch torch.initial_seed function
PyTorch torch reference manual
torch.initial_seed A function in PyTorch for returning the current random seed.
Function definition
torch.initial_seed()
Usage examples
Example
import
torch
Set the random seed
torch.
manual_seed
(
42
)
Get the current random seed
current_seed
=
torch.
initial_seed
(
)
(
"Current random seed:"
,
current_seed
)