PyTorch torch.get_num_threads function
PyTorch torch reference manual
torch.get_num_threads A function in PyTorch for getting the number of threads used for intra-parallel computation.
Function definition
torch.get_num_threads()
Usage examples
Example
import
torch
Get the current thread count
num_threads
=
torch.
get_num_threads
(
)
(
"Current thread count:"
,
num_threads
)