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