torch.cuda.get_rng_state¶ torch.cuda.get_rng_state(device='cuda')[源代码]¶ 返回指定GPU的随机数生成器状态为ByteTensor。 Parameters 设备 (torch.device 或 int, 可选) – 返回随机数生成器状态的设备。 默认值: 'cuda' (即 torch.device('cuda'), 当前的CUDA设备)。 Return type 张量 警告 此函数会立即初始化CUDA。