Skip to content

Commit 6a627ce

Browse files
author
Yibing Liu
committed
Use length-based lod in seq_slice's doc
test=develop
1 parent 18e1c1e commit 6a627ce

File tree

1 file changed

+13
-9
lines changed
  • python/paddle/fluid/layers

1 file changed

+13
-9
lines changed

python/paddle/fluid/layers/nn.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1914,19 +1914,23 @@ def sequence_slice(input, offset, length, name=None):
19141914
.. code-block:: text
19151915
19161916
- Case:
1917-
Given the input Variable **input**,
1918-
input.data = [[a1, a2], [b1, b2], [c1, c2], [d1, d2], [e1, e2]],
1919-
input.lod = [[0, 3, 5]], input.dims = (5, 2)
19201917
1921-
with offset.data = [[0], [1]], length.data = [[2], [1]],
1918+
Given the input Variable **input**:
1919+
1920+
input.data = [[a1, a2], [b1, b2], [c1, c2], [d1, d2], [e1, e2]],
1921+
input.lod = [[3, 2]],
1922+
input.dims = (5, 2),
19221923
1923-
the output Variable will be
1924+
with offset.data = [[0], [1]] and length.data = [[2], [1]],
19241925
1925-
out.data = [[a1, a2], [b1, b2], [e1, e2]],
1926-
out.lod = [[0, 2, 3]], out.dims = (3, 2)
1926+
the output Variable will be
1927+
1928+
out.data = [[a1, a2], [b1, b2], [e1, e2]],
1929+
out.lod = [[2, 1]],
1930+
out.dims = (3, 2).
19271931
1928-
NOTE: The first dimension size of input, the size of offset and Length
1929-
should be equal. The offset start from 0.
1932+
NOTE: The first dimension size of **input**, **offset** and **length**
1933+
should be equal. The **offset** should start from 0.
19301934
19311935
Args:
19321936
input(Variable): The input Variable which consists of the complete

0 commit comments

Comments
 (0)