Solved by tom in post #2 
              
              
                Hello, 
it would seem that you are looking for torch.set_num_threads. 
In ancient versions of pytorch (<0.3.1), there had been an issue with MKL threads but that seems long solved. 
Best regards 
Thomas