评价此页

torch.xpu.get_rng_state#

torch.xpu.get_rng_state(device='xpu')[source]#

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

参数

device (torch.device or int, optional) – 要返回的 RNG 状态的设备。默认值: 'xpu' (即 torch.device('xpu'),当前的 XPU 设备)。

返回类型

张量

警告

此函数将积极初始化 XPU。