PyTorch torch.seed function
PyTorch torch reference manual
torch.seed is a function in PyTorch used to set the random seed and return a new seed value.
Function definition
torch.seed()
Usage examples
Example
import
torch
Set the random seed
seed
=
torch.
seed
(
)
(
"Set seed value:"
,
seed
)
Set the random seed again
seed2
=
torch.
seed
(
)
(
"New seed value:"
,
seed2
)