Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PyTorch torch.initial_seed function

PyTorch torch.initial_seed function


PyTorch torch reference manual 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

(

)

print

(

"Current random seed:"

,

current_seed

)


PyTorch torch reference manual PyTorch torch reference manual