Skip to content

Commit eb1eb90

Browse files
committed
update pad_sequence return list of list;
1 parent 427322e commit eb1eb90

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tensorlayer/prepro.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ def pad_sequences(sequences, maxlen=None, dtype='int32', padding='post', truncat
13841384
x[idx, -len(trunc):] = trunc
13851385
else:
13861386
raise ValueError('Padding type "%s" not understood' % padding)
1387-
return x
1387+
return x.tolist()
13881388

13891389
def remove_pad_sequences(sequences, pad_id=0):
13901390
"""Remove padding.
@@ -1497,6 +1497,7 @@ def sequences_add_end_id(sequences, end_id=888):
14971497
sequences_out[i] = sequences[i] + [end_id]
14981498
return sequences_out
14991499

1500+
15001501
def sequences_add_end_id_after_pad(sequences, end_id=888, pad_id=0):
15011502
"""Add special end token(id) in the end of each sequence.
15021503

0 commit comments

Comments
 (0)