torch.xpu.get_rng_state¶ torch.xpu.get_rng_state(device='xpu')[来源][来源] ¶ 返回指定 GPU 的随机数生成器状态,以 ByteTensor 形式。 参数: device (torch.device 或 int,可选) - 返回 RNG 状态的设备。默认: 'xpu' (即, torch.device('xpu') ,当前 XPU 设备)。 返回类型: 张量 警告 此函数会积极初始化 XPU。