torch.accelerator.current_device_index torch.accelerator.current_device_index()[source][source] 返回当前加速器所选设备的索引。 返回值: 当前选中设备的索引。 返回类型: int