From e206c636fd154435973f9eeb5a8800e500bea0fa Mon Sep 17 00:00:00 2001 From: typhoonzero Date: Wed, 24 Jan 2018 16:39:35 +0800 Subject: [PATCH] update by comment, add WITH_DISTRIBUTE switch --- python/paddle/v2/fluid/tests/CMakeLists.txt | 5 +++++ python/paddle/v2/fluid/tests/test_recv_op.py | 8 -------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/python/paddle/v2/fluid/tests/CMakeLists.txt b/python/paddle/v2/fluid/tests/CMakeLists.txt index 8305316082..628ce60b40 100644 --- a/python/paddle/v2/fluid/tests/CMakeLists.txt +++ b/python/paddle/v2/fluid/tests/CMakeLists.txt @@ -1,5 +1,10 @@ file(GLOB TEST_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_*.py") string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}") + +if(NOT WITH_DISTRIBUTE) + list(REMOVE_ITEM TEST_OPS test_recv_op) +endif(NOT WITH_DISTRIBUTE) + foreach(src ${TEST_OPS}) py_test(${src} SRCS ${src}.py) endforeach() diff --git a/python/paddle/v2/fluid/tests/test_recv_op.py b/python/paddle/v2/fluid/tests/test_recv_op.py index 6ebb58ed33..5c4cec028d 100644 --- a/python/paddle/v2/fluid/tests/test_recv_op.py +++ b/python/paddle/v2/fluid/tests/test_recv_op.py @@ -47,7 +47,6 @@ class TestRecvOp(unittest.TestCase): o = layers.scale(x=x, scale=10.0) main.global_block().create_var( name=o.name, psersistable=False, dtype=o.dtype, shape=o.shape) - print main exe = fluid.Executor(place) exe.run(main) @@ -61,16 +60,9 @@ class TestRecvOp(unittest.TestCase): append_batch_size=False) fluid.initializer.Constant(value=1.0)(x, main.global_block()) layers.Send("127.0.0.1:6174", [x], [x]) - print main exe = fluid.Executor(place) exe.run(main) if __name__ == "__main__": unittest.main() - # test = TestRecvOp() - # place = fluid.CPUPlace() - # if sys.argv[1] == "server": - # test.init_serv(place) - # else: - # test.init_client(place) -- GitLab