torch.cpu.device_count¶ torch.cpu.device_count()[source][source]¶ 返回 CPU 设备数量(非核心数)。始终为 1。 注意:此函数仅用于方便编写设备无关的代码 返回类型 int