Skip to content

Commit dbe0fe6

Browse files
committed
'fix typo'
1 parent 1f38cbf commit dbe0fe6

File tree

1 file changed

+12
-2
lines changed
  • python/paddle/fluid/layers

1 file changed

+12
-2
lines changed

python/paddle/fluid/layers/nn.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,15 +2051,25 @@ def layer_norm(input,
20512051

20522052
def beam_search_decode(ids, scores, name=None):
20532053
"""
2054+
This layers is to pack the output of beam search layer into sentences and
2055+
associated scores. It is usually called after the beam search layer.
2056+
20542057
${beam_search_decode}
20552058
20562059
Args:
20572060
ids (Variable): ${ids_comment}
20582061
scores (Variable): ${scores_comment}
20592062
name (str): The name of this layer. It is optional.
2060-
2063+
20612064
Returns:
2062-
tuple: a tuple of two output variable: sentence_ids, sentence_scores
2065+
tuple(Variable): a tuple of two output variable: sentence_ids, sentence_scores
2066+
2067+
Examples:
2068+
.. code-block:: python
2069+
ids, scores = fluid.layers.beam_search(
2070+
pre_ids, ids, scores, beam_size, end_id)
2071+
sentence_ids, sentence_scores = fluid.layers.beam_search_decode(
2072+
ids, scores)
20632073
"""
20642074
helper = LayerHelper('beam_search_decode', **locals())
20652075
sentence_ids = helper.create_tmp_variable(dtype=ids.dtype)

0 commit comments

Comments
 (0)