评价此页

torch.cuda.get_rng_state#

torch.cuda.get_rng_state(device='cuda')[源代码]#

将指定 GPU 的随机数生成器状态作为 ByteTensor 返回。

参数

device (torch.deviceint, 可选) – 要返回其 RNG 状态的设备。默认为 'cuda' (即 torch.device('cuda'),当前 CUDA 设备)。

返回类型

张量

警告

此函数会立即初始化 CUDA。