How to set the correct number of threads for parallelism?

My CPU has 4 physical cores and with hyperthreading, I get 8 threads to work with. When I run torch.get_num_threads() the output is 4.

So my question is, Is this the optimal value or should I set this value to 8?

Also, should I do the same for torch.get_num_interop_threads()?