How to run multiple models in different C++ threads with different num_threads

Hi. I have a multi-threaded program with a different torch model in each thread. For some of the models I’d like to pin the thread to multiple cores and use set_num_threads(2) or more, and for some smaller models I’d like to pin them to one core and set_num_threads(1). However, my understanding is that this is a global property. Is there any way to accomplish this?

Thanks,
James