My PC has 8 cores, results of running torch::get_num_threads()  and omp_get_max_threads() are difference. Also, calling torch::set_num_threads(1) made no effect on omp_get_max_threads()
std::cout << torch::get_num_threads() << std::endl;
-1
std::cout << omp_get_max_threads() << std::endl;
8
torch::set_num_threads(1);
std::cout << omp_get_max_threads() << std::endl;
8
std::cout << torch::get_num_threads() << std::endl;
1
omp_set_num_threads(1);
std::cout << omp_get_max_threads() << std::endl;
1