Rate this Page

device#

classtorch.xpu.device(device)[source]#

Context-manager that changes the selected device.

Parameters

device (torch.device orint orstr) – device index to select. It’s a no-op ifthis argument is a negative integer orNone.