提交 b80590d7 编写于 作者: Y Yu Yang

Remove test_plain_net

上级 0467cd2d
...@@ -3,7 +3,7 @@ add_python_test(test_framework ...@@ -3,7 +3,7 @@ add_python_test(test_framework
test_scope.py test_scope.py
test_default_scope_funcs.py test_default_scope_funcs.py
test_op_creation_methods.py test_op_creation_methods.py
test_plain_net.py test_net.py
test_tensor.py test_tensor.py
test_fc_op.py test_fc_op.py
test_add_two_op.py test_add_two_op.py
......
...@@ -14,14 +14,16 @@ class TestNet(unittest.TestCase): ...@@ -14,14 +14,16 @@ class TestNet(unittest.TestCase):
net2.complete_add_op(True) net2.complete_add_op(True)
net.add_op(net2) net.add_op(net2)
net.complete_add_op(True) 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). Op(add_two), inputs:(X, Y), outputs:(Out).
naive_net: Op(plain_net), inputs:(@EMPTY@, X, w), outputs:(@TEMP@fc@0, fc.out).
fc: Op(fc), inputs:(X, w, @EMPTY@), outputs:(fc.out, @TEMP@fc@0).
Op(mul), inputs:(X, w), outputs:(@TEMP@fc@0). Op(mul), inputs:(X, w), outputs:(@TEMP@fc@0).
Op(sigmoid), inputs:(@TEMP@fc@0), outputs:(fc.out). Op(sigmoid), inputs:(@TEMP@fc@0), outputs:(fc.out).
''' '''
self.assertEqual(expected, str(net)) self.assertEqual(expected, "\n" + str(net))
if __name__ == '__main__': if __name__ == '__main__':
......
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()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册