torch.xpu.set_device¶ torch.xpu.set_device(device)[source][source]¶ 设置当前设备。 参数: device (torch.device 或 int 或 str) – 选择设备。如果此参数为负数,则此函数为空操作。