mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
Relax set_num_threads restriction in parallel native case (#27947)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/27947 Don't throw exception if the requested size is the same as the currently used one Test Plan: ATEN_THREADING=NATIVE python setup.py develop --cmake Imported from OSS Differential Revision: D17919416 fbshipit-source-id: 411f7c9bd6a46e7a003b43a200c2ce3b76453a2e
This commit is contained in:
committed by
Facebook Github Bot
parent
2265cddbd2
commit
19956b200d
@@ -8,7 +8,7 @@
|
||||
TEST(TorchIncludeTest, GetSetNumThreads) {
|
||||
torch::init_num_threads();
|
||||
torch::set_num_threads(2);
|
||||
ASSERT_EQ(torch::get_num_threads(), 2);
|
||||
torch::set_num_interop_threads(2);
|
||||
ASSERT_EQ(torch::get_num_interop_threads(), 2);
|
||||
torch::get_num_threads();
|
||||
torch::get_num_interop_threads();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user