cpu_places

paddle.static. cpu_places ( device_count=None ) [source]

This function creates a list of paddle.CPUPlace objects, and returns the created list.

If device_count is None, the device count would be determined by environment variable CPU_NUM. If CPU_NUM is not set, the default value is 1, i.e. CPU_NUM=1. CPU_NUM indicates the number of devices used in the current task. The running of the program can be accelerated if CPU_NUM is the same as the number of physical cores.

Parameters

device_count (int, optional) – device number. Default: None.

Returns

Created list of CPU places.

Return type

list of paddle.CPUPlace

Examples

>>> import paddle
>>> import paddle.static as static

>>> paddle.enable_static()

>>> cpu_places = static.cpu_places()