提交 977fcef7 编写于 作者: Y Yu Yang

Fix unittest

上级 75f2e54c
...@@ -16,6 +16,7 @@ import paddle.v2.layer as layer ...@@ -16,6 +16,7 @@ import paddle.v2.layer as layer
import paddle.v2.topology as topology import paddle.v2.topology as topology
import paddle.v2.data_type as data_type import paddle.v2.data_type as data_type
import paddle.trainer_config_helpers as conf_helps import paddle.trainer_config_helpers as conf_helps
import paddle.trainer.PyDataProvider2 as pydp2
class TestTopology(unittest.TestCase): class TestTopology(unittest.TestCase):
...@@ -35,13 +36,13 @@ class TestTopology(unittest.TestCase): ...@@ -35,13 +36,13 @@ class TestTopology(unittest.TestCase):
pixel_data_type = filter(lambda type: type[0] == "pixel", data_types) pixel_data_type = filter(lambda type: type[0] == "pixel", data_types)
self.assertEqual(len(pixel_data_type), 1) self.assertEqual(len(pixel_data_type), 1)
pixel_data_type = pixel_data_type[0] pixel_data_type = pixel_data_type[0]
self.assertEqual(pixel_data_type[1].type, data_type.DataType.Dense) self.assertEqual(pixel_data_type[1].type, pydp2.DataType.Dense)
self.assertEqual(pixel_data_type[1].dim, 784) self.assertEqual(pixel_data_type[1].dim, 784)
label_data_type = filter(lambda type: type[0] == "label", data_types) label_data_type = filter(lambda type: type[0] == "label", data_types)
self.assertEqual(len(label_data_type), 1) self.assertEqual(len(label_data_type), 1)
label_data_type = label_data_type[0] label_data_type = label_data_type[0]
self.assertEqual(label_data_type[1].type, data_type.DataType.Index) self.assertEqual(label_data_type[1].type, pydp2.DataType.Index)
self.assertEqual(label_data_type[1].dim, 10) self.assertEqual(label_data_type[1].dim, 10)
def test_get_layer(self): def test_get_layer(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册