未验证 提交 aed702ce 编写于 作者: T Tao Luo 提交者: GitHub

Merge pull request #16920 from qingqing01/test_profile

Fix test_profiler when the machine has many cores.
...@@ -26,6 +26,10 @@ import paddle.fluid.proto.profiler.profiler_pb2 as profiler_pb2 ...@@ -26,6 +26,10 @@ import paddle.fluid.proto.profiler.profiler_pb2 as profiler_pb2
class TestProfiler(unittest.TestCase): class TestProfiler(unittest.TestCase):
@classmethod
def setUpClass(cls):
os.environ['CPU_NUM'] = str(4)
def net_profiler(self, state, use_parallel_executor=False): def net_profiler(self, state, use_parallel_executor=False):
profile_path = os.path.join(tempfile.gettempdir(), "profile") profile_path = os.path.join(tempfile.gettempdir(), "profile")
open(profile_path, "w").write("") open(profile_path, "w").write("")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册