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