提交 699825a9 编写于 作者: Y Yibing Liu

Use length-based lod in seq_unpad's doc

test=develop
上级 b7857985
...@@ -2848,7 +2848,7 @@ def sequence_pad(x, pad_value, maxlen=None, name=None): ...@@ -2848,7 +2848,7 @@ def sequence_pad(x, pad_value, maxlen=None, name=None):
def sequence_unpad(x, length, name=None): def sequence_unpad(x, length, name=None):
""" """
Sequence Unpad Layer **Sequence Unpad Layer**
This layer removes the padding data in the input sequences and convert This layer removes the padding data in the input sequences and convert
them into sequences with actual length as output, identitied by lod them into sequences with actual length as output, identitied by lod
...@@ -2864,14 +2864,14 @@ def sequence_unpad(x, length, name=None): ...@@ -2864,14 +2864,14 @@ def sequence_unpad(x, length, name=None):
[11.0, 12.0, 13.0, 14.0, 15.0]], [11.0, 12.0, 13.0, 14.0, 15.0]],
in which there are 3 sequences padded to length 5, and the acutal length in which there are 3 sequences padded to length 5, and the acutal length
specified by input Variable *length*: specified by input Variable **length**:
length.data = [[2], [3], [4]], length.data = [[2], [3], [4]],
after unpadding, the output Variable will be: after unpadding, the output Variable will be:
out.data = [[1.0, 2.0, 6.0, 7.0, 8.0, 11.0, 12.0, 13.0, 14.0]] out.data = [[1.0, 2.0, 6.0, 7.0, 8.0, 11.0, 12.0, 13.0, 14.0]]
out.lod = [[0, 2, 5, 9]] out.lod = [[2, 3, 4]]
Args: Args:
x(Variable): Input Variable which contains the padded sequences with x(Variable): Input Variable which contains the padded sequences with
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册