Skip to content

Commit ce773ed

Browse files
author
Yibing Liu
committed
Fix unitttest in sequence_pad_op
1 parent 9e3245e commit ce773ed

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

python/paddle/fluid/tests/unittests/test_sequence_pad_op.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def compute(self):
6262
start_idx = end_idx
6363

6464
out_data = np.array(padded_sequences)
65-
length = np.array(self.x_len_lod[0])
65+
length = np.array(self.x_len_lod[0]).reshape((-1, 1))
6666
self.outputs = {'Out': out_data, 'Length': length}
6767

6868
def setUp(self):
@@ -130,3 +130,7 @@ def set_attr(self):
130130
self.pad_value = [1.0]
131131
self.padded_length = 7
132132
self.dtype = 'float32'
133+
134+
135+
if __name__ == '__main__':
136+
unittest.main()

0 commit comments

Comments
 (0)