PyTorch uses multiple threads in the default configuration, if you want PyTorch to only use one thread per process, you would want to disable that:
https://pytorch.org/docs/stable/torch.html#parallelism 8