Skip to content

Commit cf5be6a

Browse files
authored
Merge pull request #14561 from sneaxiy/fix_increment_op_doc
Fix increment_op doc
2 parents bf222f1 + 5ca56ca commit cf5be6a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

python/paddle/fluid/layers/control_flow.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -896,9 +896,10 @@ def array_to_lod_tensor(x, table):
896896

897897
def increment(x, value=1.0, in_place=True):
898898
"""
899-
This function performs an operation that increments each value in the
899+
This function performs an operation that increments the value in the
900900
input :math:`x` by an amount: :math:`value` as mentioned in the input
901-
parameter. This operation is performed in-place by default.
901+
parameter. This operation is performed in-place by default. Notice that
902+
the number of elements in :math:`x` must be equal to 1.
902903
903904
Args:
904905
x (Variable|list): The tensor that has the input values.
@@ -911,7 +912,8 @@ def increment(x, value=1.0, in_place=True):
911912
Examples:
912913
.. code-block:: python
913914
914-
data = fluid.layers.data(name='data', shape=[32, 32], dtype='float32')
915+
data = fluid.layers.data(name='data', shape=[1], dtype='float32',
916+
append_batch_size=False)
915917
data = fluid.layers.increment(x=data, value=3.0, in_place=True)
916918
"""
917919
helper = LayerHelper("increment", **locals())

0 commit comments

Comments
 (0)