Rate this Page

torch.accelerator.current_device_idx#

torch.accelerator.current_device_idx()[source]#

(Deprecated) Return the index of a currently selected device for the currentaccelerator.

Returns

the index of a currently selected device.

Return type

int

Warning

torch.accelerator.current_device_idx() is deprecated in favor oftorch.accelerator.current_device_index()and will be removed in a future PyTorch release.