評價此頁

device#

class torch.xpu.device(device)[原始碼]#

更改選定裝置的上下文管理器。

引數

device (torch.deviceintstr) – 要選擇的裝置索引。如果此引數為負整數或 None,則此操作無效。