From b80590d70b9d5d963cbf077671b4458f46cc9713 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Tue, 25 Jul 2017 13:33:42 +0800 Subject: [PATCH] Remove test_plain_net --- .../paddle/v2/framework/tests/CMakeLists.txt | 2 +- python/paddle/v2/framework/tests/test_net.py | 10 ++++--- .../v2/framework/tests/test_plain_net.py | 30 ------------------- 3 files changed, 7 insertions(+), 35 deletions(-) delete mode 100644 python/paddle/v2/framework/tests/test_plain_net.py diff --git a/python/paddle/v2/framework/tests/CMakeLists.txt b/python/paddle/v2/framework/tests/CMakeLists.txt index 7d1229a34c..cdaaa60674 100644 --- a/python/paddle/v2/framework/tests/CMakeLists.txt +++ b/python/paddle/v2/framework/tests/CMakeLists.txt @@ -3,7 +3,7 @@ add_python_test(test_framework test_scope.py test_default_scope_funcs.py test_op_creation_methods.py - test_plain_net.py + test_net.py test_tensor.py test_fc_op.py test_add_two_op.py diff --git a/python/paddle/v2/framework/tests/test_net.py b/python/paddle/v2/framework/tests/test_net.py index 6a97c24990..db776d6b64 100644 --- a/python/paddle/v2/framework/tests/test_net.py +++ b/python/paddle/v2/framework/tests/test_net.py @@ -14,14 +14,16 @@ class TestNet(unittest.TestCase): net2.complete_add_op(True) net.add_op(net2) net.complete_add_op(True) - expected = '''naive_net: + + expected = ''' +Op(plain_net), inputs:(@EMPTY@, X, Y, w), outputs:(@TEMP@fc@0, Out, fc.out). Op(add_two), inputs:(X, Y), outputs:(Out). - naive_net: - fc: + Op(plain_net), inputs:(@EMPTY@, X, w), outputs:(@TEMP@fc@0, fc.out). + Op(fc), inputs:(X, w, @EMPTY@), outputs:(fc.out, @TEMP@fc@0). Op(mul), inputs:(X, w), outputs:(@TEMP@fc@0). Op(sigmoid), inputs:(@TEMP@fc@0), outputs:(fc.out). ''' - self.assertEqual(expected, str(net)) + self.assertEqual(expected, "\n" + str(net)) if __name__ == '__main__': diff --git a/python/paddle/v2/framework/tests/test_plain_net.py b/python/paddle/v2/framework/tests/test_plain_net.py deleted file mode 100644 index 2b919aca28..0000000000 --- a/python/paddle/v2/framework/tests/test_plain_net.py +++ /dev/null @@ -1,30 +0,0 @@ -import paddle.v2.framework.core as core -from paddle.v2.framework.create_op_creation_methods import op_creations -import unittest - - -class TestNet(unittest.TestCase): - def test_net_all(self): - net = core.PlainNet.create() - op1 = op_creations.add_two(X="X", Y="Y", Out="Out") - net.add_op(op1) - - net2 = core.PlainNet.create() - net2.add_op(op_creations.fc(X="X", W="w", Y="fc.out")) - net2.complete_add_op(True) - net.add_op(net2) - net.complete_add_op(True) - - expected = ''' -Op(plain_net), inputs:(@EMPTY@, X, Y, w), outputs:(@TEMP@fc@0, Out, fc.out). - Op(add_two), inputs:(X, Y), outputs:(Out). - Op(plain_net), inputs:(@EMPTY@, X, w), outputs:(@TEMP@fc@0, fc.out). - Op(fc), inputs:(X, w, @EMPTY@), outputs:(fc.out, @TEMP@fc@0). - Op(mul), inputs:(X, w), outputs:(@TEMP@fc@0). - Op(sigmoid), inputs:(@TEMP@fc@0), outputs:(fc.out). -''' - self.assertEqual(expected, "\n" + str(net)) - - -if __name__ == '__main__': - unittest.main() -- GitLab