torch.accelerator.set_device_idx#
- torch.accelerator.set_device_idx(device, /)[source]#
将当前设备索引设置为给定设备。
- 参数
device (
torch.device
, str, int) – a given device that must match the current accelerator device type.
注意
This function is a no-op if this device index is negative.