提交 8536d261 编写于 作者: G guosheng

Fix doc format of beam_search

上级 4e9d7ddb
...@@ -2745,6 +2745,7 @@ def beam_search_decode(ids, scores, beam_size, end_id, name=None): ...@@ -2745,6 +2745,7 @@ def beam_search_decode(ids, scores, beam_size, end_id, name=None):
whose lods can be used to restore the path in the beam search tree. whose lods can be used to restore the path in the beam search tree.
Please see the following demo for a fully beam search usage example: Please see the following demo for a fully beam search usage example:
fluid/tests/book/test_machine_translation.py fluid/tests/book/test_machine_translation.py
Args: Args:
ids(Variable): The LodTensorArray variable containing the selected ids ids(Variable): The LodTensorArray variable containing the selected ids
of all steps. of all steps.
...@@ -2754,12 +2755,14 @@ def beam_search_decode(ids, scores, beam_size, end_id, name=None): ...@@ -2754,12 +2755,14 @@ def beam_search_decode(ids, scores, beam_size, end_id, name=None):
end_id(int): The id of end token. end_id(int): The id of end token.
name(str|None): A name for this layer(optional). If set None, the layer name(str|None): A name for this layer(optional). If set None, the layer
will be named automatically. will be named automatically.
Returns: Returns:
Variable: The LodTensor pair containing the generated id sequences \ Variable: The LodTensor pair containing the generated id sequences \
and the corresponding scores. The shapes and lods of the two \ and the corresponding scores. The shapes and lods of the two \
LodTensor are same. The lod level is 2 and the two levels \ LodTensor are same. The lod level is 2 and the two levels \
separately indicate how many hypotheses each source sentence has \ separately indicate how many hypotheses each source sentence has \
and how many ids each hypothesis has. and how many ids each hypothesis has.
Examples: Examples:
.. code-block:: python .. code-block:: python
# Suppose `ids` and `scores` are LodTensorArray variables reserving # Suppose `ids` and `scores` are LodTensorArray variables reserving
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册