torch.xpu.set_device

torch.xpu.set_device(device)[源代码]

设置当前设备。

参数

device (torch.deviceintstr) – 选择的设备。如果此参数为负数,则该函数将不做任何处理。

本页目录