torch.xpu.set_device¶ torch.xpu.set_device(device)[source][source]¶ 設定當前裝置。 引數 device (torch.device 或 int 或 str) – 選擇的裝置。如果此引數為負,則此函式為空操作(no-op)。