MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / device_count

Function device_count

python/paddle/device/cpu.py:40–58  ·  view source on GitHub ↗

Return the number of GPUs available. Returns: int: the number of GPUs available. Note: This function returns 0 when compiled without CUDA support. Examples: .. code-block:: pycon >>> import paddle >>> paddle.device.device_count()

()

Source from the content-addressed store, hash-verified

38
39
40def device_count() -> int:
41 '''
42 Return the number of GPUs available.
43
44 Returns:
45 int: the number of GPUs available.
46
47 Note:
48 This function returns 0 when compiled without CUDA support.
49
50 Examples:
51 .. code-block:: pycon
52
53 >>> import paddle
54
55 >>> paddle.device.device_count()
56
57 '''
58 return 0
59
60
61def get_rng_state(

Callers 9

is_availableFunction · 0.70
extract_device_idFunction · 0.70
TESTFunction · 0.50
TESTFunction · 0.50
TESTFunction · 0.50
TESTFunction · 0.50
TESTFunction · 0.50
TESTFunction · 0.50
TESTFunction · 0.50

Calls

no outgoing calls

Tested by 7

TESTFunction · 0.40
TESTFunction · 0.40
TESTFunction · 0.40
TESTFunction · 0.40
TESTFunction · 0.40
TESTFunction · 0.40
TESTFunction · 0.40