torch.xpu.set_device¶ torch.xpu.set_device(device)[source][source]¶ 設定目前的裝置。 參數 device ( torch.device 或 int 或 str ) – 選定的裝置。如果此參數為負數,則此函數不執行任何操作。