mindspore.device_context.cpu.device_count

View Source On Gitee
mindspore.device_context.cpu.device_count()[source]

Returns compute-capable device count of CPU.

Note

  • For CPU hardware, 1 is always returned.

Returns

int, The number of compute-capable CPU devices.

Examples

>>> import mindspore as ms
>>> print(ms.device_context.cpu.device_count())
1