提交 6ac8383f 编写于 作者: D dzhwinter

"fix based comments"

上级 0d86f13c
...@@ -38,7 +38,7 @@ class UniformRandomBatchSizeLikeOpMaker : public BatchSizeLikeOpMaker { ...@@ -38,7 +38,7 @@ class UniformRandomBatchSizeLikeOpMaker : public BatchSizeLikeOpMaker {
UniformRandomBatchSizeLike operator. UniformRandomBatchSizeLike operator.
This operator initializes a tensor with the same batch_size as the Input tensor This operator initializes a tensor with the same batch_size as the Input tensor
with random values sampled from a uniform distribution. with random values sampled from a uniform distribution.
)DOC"); )DOC");
AddAttr<float>("min", AddAttr<float>("min",
......
...@@ -1130,6 +1130,8 @@ class Program(object): ...@@ -1130,6 +1130,8 @@ class Program(object):
def clone(self, for_test=False): def clone(self, for_test=False):
"""Clone the Program object """Clone the Program object
Args:
for_test(bool): indicate whether clone for test.
Set for_test to False when we want to clone the program for training. Set for_test to False when we want to clone the program for training.
Set for_test to True when we want to clone the program for testing. Set for_test to True when we want to clone the program for testing.
...@@ -1140,8 +1142,9 @@ class Program(object): ...@@ -1140,8 +1142,9 @@ class Program(object):
the is_test attributes in these operators will be set to True for the is_test attributes in these operators will be set to True for
testing purposes, otherwise, they remain unchanged. testing purposes, otherwise, they remain unchanged.
Returns(Program): Returns:
The cloned Program object. Program: The cloned Program object.
""" """
if for_test: if for_test:
p = self.inference_optimize() p = self.inference_optimize()
...@@ -1259,6 +1262,7 @@ class Program(object): ...@@ -1259,6 +1262,7 @@ class Program(object):
def copy_param_info_from(self, other): def copy_param_info_from(self, other):
""" """
Copy the information of parameters from other program. Copy the information of parameters from other program.
Args: Args:
other(Program): Other program other(Program): Other program
...@@ -1277,6 +1281,7 @@ class Program(object): ...@@ -1277,6 +1281,7 @@ class Program(object):
def copy_data_info_from(self, other): def copy_data_info_from(self, other):
""" """
Copy the information of data variables from other program. Copy the information of data variables from other program.
Args: Args:
other(Program): Other program other(Program): Other program
...@@ -1330,6 +1335,7 @@ class Parameter(Variable): ...@@ -1330,6 +1335,7 @@ class Parameter(Variable):
def to_string(self, throw_on_error, with_details=False): def to_string(self, throw_on_error, with_details=False):
""" """
To debug string. To debug string.
Args: Args:
throw_on_error(bool): raise exception when self is not initialized throw_on_error(bool): raise exception when self is not initialized
when throw_on_error is True when throw_on_error is True
......
...@@ -823,8 +823,7 @@ def increment(x, value=1.0, in_place=True): ...@@ -823,8 +823,7 @@ def increment(x, value=1.0, in_place=True):
in_place (bool): If the increment should be performed in-place. in_place (bool): If the increment should be performed in-place.
Returns: Returns:
Variable: The tensor variable storing the transformation of Variable: The elementwise-incremented object.
element-wise increment of each value in the input.
Examples: Examples:
.. code-block:: python .. code-block:: python
......
...@@ -2061,8 +2061,6 @@ def beam_search_decode(ids, scores, name=None): ...@@ -2061,8 +2061,6 @@ def beam_search_decode(ids, scores, name=None):
based on the score of each id. This layer takes the output of beam search based on the score of each id. This layer takes the output of beam search
layer as input and repack them into sentences. layer as input and repack them into sentences.
${beam_search_decode}
Args: Args:
ids (Variable): The selected ids, output of beam search layer. ids (Variable): The selected ids, output of beam search layer.
scores (Variable): The associated scores of the ids, out put of beam scores (Variable): The associated scores of the ids, out put of beam
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册