mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/20659 ghimport-source-id: 4858d03a9f89c613f64901c3430a7b212f76eb95 Reviewed By: dzhulgakov Differential Revision: D15399780 Pulled By: ilia-cher fbshipit-source-id: c1c3cb628c5ee664468f9d181bcd76a5105a89fd
15 lines
429 B
C++
15 lines
429 B
C++
#include <gtest/gtest.h>
|
|
|
|
#include <torch/torch.h>
|
|
|
|
// NOTE: This test suite exists to make sure that common `torch::` functions
|
|
// can be used without additional includes beyond `torch/torch.h`.
|
|
|
|
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);
|
|
}
|