`num_threads` in `torch.utils.benchmark` only for CPU?

The benchmark tutorial (below), and the function’s docs state that the default is num_threads=1, which doesn’t make much sense on a GPU. Is it only referring to the CPU, and does benchmark use all GPU threads? torch.get_num_threads() also returns the CPU count.


From the docs:

Returns the number of threads used for parallelizing CPU operations

So yes, the threads setting refers to CPU-only workloads.

The benchmark util. won’t specify or change the device and your code is responsible to use the GPU or CPU.