Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PyTorch torch.get_num_threads function

PyTorch torch.get_num_threads function


PyTorch torch reference manual 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

(

)

print

(

"Current thread count:"

,

num_threads

)


PyTorch torch reference manual PyTorch torch reference manual