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

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L