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