device¶ class torch.cuda.device(device)[原始碼][原始碼]¶ 此上下文管理器會變更所選的裝置。 參數 device (torch.device 或 int) – 要選取的裝置索引。 如果此引數為負整數或 None,則不執行任何動作。