utils.devices

utils.devices#

Functions for working with the torch.device module

Functions

cpu

Get the CPU device

gpu

Get a GPU device

num_gpus

Get the number of available GPUs

try_all_gpus

Return all available GPUs, or [cpu(),] if no GPU exists

try_gpu

Return gpu(i) if exists, otherwise return None