- paddle.static. cpu_places ( device_count=None )
This function creates a list of
paddle.CPUPlaceobjects, and returns the created list.
device_countis None, the device count would be determined by environment variable
CPU_NUMis not set, the default value is 1, i.e. CPU_NUM=1.
CPU_NUMindicates the number of devices used in the current task. The running of the program can be accelerated if
CPU_NUMis the same as the number of physical cores.
device_count (int, optional) – device number. Default: None.
Created list of CPU places.
- Return type
list of paddle.CPUPlace
import paddle import paddle.static as static paddle.enable_static() cpu_places = static.cpu_places()