Learn Before
Code
Querying Available GPUs in PyTorch
The number of available GPUs on a system can be queried in PyTorch using the function torch.cuda.device_count().
0
1
Updated 2026-05-09
Tags
D2L
Dive into Deep Learning @ D2L
Querying Available GPUs in PyTorch
The number of available GPUs on a system can be queried in PyTorch using the function torch.cuda.device_count().
0
1
Tags
D2L
Dive into Deep Learning @ D2L