torch.xpu.set_device¶ torch.xpu.set_device(device)[源代码]¶ 设置当前设备。 Parameters 设备 (torch.device 或 整数 或 字符串) – 选择的设备。如果此参数为负数,则此函数不执行任何操作。