评价此页

torch.accelerator.current_device_idx#

torch.accelerator.current_device_idx()[source]#

返回当前选择的 加速器 的设备索引。

返回

当前选定设备的索引。

返回类型

int