torch.cuda.get_rng_state — PyTorch 2.7 documentation (original) (raw)
torch.cuda.get_rng_state(device='cuda')[source][source]¶
Return the random number generator state of the specified GPU as a ByteTensor.
Parameters
device (torch.device or int, optional) – The device to return the RNG state of. Default: 'cuda'
(i.e., torch.device('cuda')
, the current CUDA device).
Return type
Warning
This function eagerly initializes CUDA.
To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.