From ce773ed7f84a8d08e64590670171a9100b1a33e7 Mon Sep 17 00:00:00 2001 From: Yibing Liu Date: Fri, 14 Sep 2018 11:45:26 +0000 Subject: [PATCH] Fix unitttest in sequence_pad_op --- python/paddle/fluid/tests/unittests/test_sequence_pad_op.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/paddle/fluid/tests/unittests/test_sequence_pad_op.py b/python/paddle/fluid/tests/unittests/test_sequence_pad_op.py index 3ac7371aa70..3067294e5bb 100644 --- a/python/paddle/fluid/tests/unittests/test_sequence_pad_op.py +++ b/python/paddle/fluid/tests/unittests/test_sequence_pad_op.py @@ -62,7 +62,7 @@ class TestSequencePadOp(OpTest): start_idx = end_idx out_data = np.array(padded_sequences) - length = np.array(self.x_len_lod[0]) + length = np.array(self.x_len_lod[0]).reshape((-1, 1)) self.outputs = {'Out': out_data, 'Length': length} def setUp(self): @@ -130,3 +130,7 @@ class TestSequencePadOp7(TestSequencePadOp): self.pad_value = [1.0] self.padded_length = 7 self.dtype = 'float32' + + +if __name__ == '__main__': + unittest.main() -- GitLab