Shortcuts

torch.cpu.device_count

torch.cpu.device_count()[源代码]

返回CPU设备的数量(不是核心数)。始终为1。

注意:此函数仅用于实现设备无关的代码

Return type

int