get_all_device_type

paddle.device. get_all_device_type ( ) [源代码]

该功能获得所有可用的设备类型。

返回

返回列表包含所有可用的设备类型。

代码示例

>>> import paddle
>>> paddle.device.get_all_device_type()

>>> # Case 1: paddlepaddle-cpu package installed, and no custom device registered.
>>> # Output: ['cpu']

>>> # Case 2: paddlepaddle-gpu package installed, and no custom device registered.
>>> # Output: ['cpu', 'gpu']

>>> # Case 3: paddlepaddle-cpu package installed, and custom device 'CustomCPU' is registered.
>>> # Output: ['cpu', 'CustomCPU']

>>> # Case 4: paddlepaddle-gpu package installed, and custom device 'CustomCPU' and 'CustomGPU' is registered.
>>> # Output: ['cpu', 'gpu', 'CustomCPU', 'CustomGPU']