Rate this Page

Function torch ::stable ::accelerator::getCurrentDeviceIndex#

Function Documentation#

inline DeviceIndex torch::stable::accelerator::getCurrentDeviceIndex()#

Gets the current device index.

Returns the index of the currently active device for the accelerator.

Minimum compatible version: PyTorch 2.9.

Returns:

The current device index.