device_count

paddle.device.cuda. device_count ( ) [source]

Return the number of GPUs available.

Returns

the number of GPUs available.

Return type

int

Examples

>>> import paddle

>>> paddle.device.cuda.device_count()