torch.accelerator.current_device_idx#
- torch.accelerator.current_device_idx()[源代码]#
(已弃用) 返回当前为 accelerator 选择的设备的索引。
- 返回
当前选定设备的索引。
- 返回类型
警告
torch.accelerator.current_device_idx()
已弃用,推荐使用torch.accelerator.current_device_index()
,并将在未来的 PyTorch 版本中移除。