Function torch ::stable ::accelerator::getCurrentDeviceIndex#
Defined in File accelerator.h
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.