torch.accelerator.random.get_rng_state#
- torch.accelerator.random.get_rng_state(device=None, /)[source]#
Return the RNG state of the default
torch.Generatorfor the current accelerator as a torch.Tensor of dtype torch.uint8 for the specified accelerator device.- Parameters:
device (
torch.device, str, int, optional) – The device to return the RNG state of. If not given, usestorch.accelerator.current_device_index()by default.- Returns:
the RNG state of the default generator for the specified device.
- Return type:
Warning
This function eagerly initializes the accelerator runtime.