torch.accelerator.device_count¶ torch.accelerator.device_count()[source][source]¶ 返回當前可用加速器的數量。 返回 當前可用加速器的數量。如果沒有可用的加速器,則返回 0。 返回型別 int