Rate this Page

torch.accelerator.random.initial_seed#

torch.accelerator.random.initial_seed(device=None, /)[source]#

Return the initial seed of the default torch.Generator for the current accelerator on the specified device.

Parameters:

device (torch.device, str, int, optional) – The device to return the initial seed of. If not given, uses torch.accelerator.current_device_index() by default.

Returns:

the initial seed of the default generator for the specified device.

Return type:

int

Warning

This function eagerly initializes the accelerator runtime.