Skip to content

Commit 699825a

Browse files
author
Yibing Liu
committed
Use length-based lod in seq_unpad's doc
test=develop
1 parent b785798 commit 699825a

File tree

1 file changed

+3
-3
lines changed
  • python/paddle/fluid/layers

1 file changed

+3
-3
lines changed

python/paddle/fluid/layers/nn.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2848,7 +2848,7 @@ def sequence_pad(x, pad_value, maxlen=None, name=None):
28482848

28492849
def sequence_unpad(x, length, name=None):
28502850
"""
2851-
Sequence Unpad Layer
2851+
**Sequence Unpad Layer**
28522852
28532853
This layer removes the padding data in the input sequences and convert
28542854
them into sequences with actual length as output, identitied by lod
@@ -2864,14 +2864,14 @@ def sequence_unpad(x, length, name=None):
28642864
[11.0, 12.0, 13.0, 14.0, 15.0]],
28652865
28662866
in which there are 3 sequences padded to length 5, and the acutal length
2867-
specified by input Variable *length*:
2867+
specified by input Variable **length**:
28682868
28692869
length.data = [[2], [3], [4]],
28702870
28712871
after unpadding, the output Variable will be:
28722872
28732873
out.data = [[1.0, 2.0, 6.0, 7.0, 8.0, 11.0, 12.0, 13.0, 14.0]]
2874-
out.lod = [[0, 2, 5, 9]]
2874+
out.lod = [[2, 3, 4]]
28752875
28762876
Args:
28772877
x(Variable): Input Variable which contains the padded sequences with

0 commit comments

Comments
 (0)