torchoutil.utils.data.dataloader module

get_auto_num_cpus() int[source]

Returns the number of CPUs available for the process on Linux-based platforms. Useful for setting num_workers argument in DataLoaders.

On Windows and MAC OS, this will just return the number of CPUs on this machine. If the number of CPUs cannot be detected, returns 0.

Alias of pyoutil.os.get_num_cpus.

get_auto_num_gpus() int[source]

Returns the number of GPUs available to the current process.