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