Skip to content

Commit 7d11f10

Browse files
committed
update merge_selected_rows
1 parent bce0084 commit 7d11f10

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

python/paddle/fluid/layers/control_flow.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -941,9 +941,6 @@ def less_than(x, y, force_cpu=None, cond=None):
941941
"""
942942
${comment}
943943
944-
>>> import paddle.fluid as fluid
945-
>>> less = fluid.layers.less_than(x=label, y=limit)
946-
947944
Args:
948945
x(${x_type}): ${x_comment}.
949946
y(${y_type}): ${y_comment}.
@@ -955,6 +952,7 @@ def less_than(x, y, force_cpu=None, cond=None):
955952
956953
Examples:
957954
.. code-block:: python
955+
958956
out = fluid.layers.less_than(x=label, y=limit)
959957
"""
960958
helper = LayerHelper("less_than", **locals())

python/paddle/fluid/layers/nn.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9825,9 +9825,11 @@ def merge_selected_rows(x, name=None):
98259825
Examples:
98269826
.. code-block:: python
98279827
9828-
input = fluid.layers.data(
9829-
name='data', shape=[2, 3], dtype='float32')
9830-
mean = fluid.layers.mean(input)
9828+
b = fluid.default_main_program().global_block()
9829+
var = b.create_var(
9830+
name="X", dtype="float32", persistable=True,
9831+
type=fluid.core.VarDesc.VarType.SELECTED_ROWS)
9832+
y = fluid.layers.merge_selected_rows(var)
98319833
"""
98329834

98339835
helper = LayerHelper("merge_selected_rows", **locals())

0 commit comments

Comments
 (0)