未验证 提交 0e6b43a6 编写于 作者: Y Yang Zhang 提交者: GitHub

[Cherry-pick Release 2.0] Minor fix to `MSELoss` docstring (#24078)

* Indent MSELoss example docs

* Point out input tensors should be of same shape

test=develop

* Document `MSELoss` input and return parameters

test=release/2.0-beta,test=document_fix
上级 014b1aff
...@@ -155,17 +155,27 @@ class MSELoss(fluid.dygraph.layers.Layer): ...@@ -155,17 +155,27 @@ class MSELoss(fluid.dygraph.layers.Layer):
.. math:: .. math::
Out = \operatorname{sum}((input - label)^2) Out = \operatorname{sum}((input - label)^2)
where `input` and `label` are `float32` tensors of arbitrary shapes. where `input` and `label` are `float32` tensors of same shape.
Parameters: Parameters:
input (Variable): Input tensor, the data type is float32,
label (Variable): Label tensor, the data type is float32,
reduction (string, optional): The reduction method for the output, reduction (string, optional): The reduction method for the output,
could be 'none' | 'mean' | 'sum'. could be 'none' | 'mean' | 'sum'.
'none': no reduction will be applied If :attr:`reduction` is ``'mean'``, the reduced mean loss is returned.
'mean': the output will be averaged If :attr:`size_average` is ``'sum'``, the reduced sum loss is returned.
'sum': the output will be summed If :attr:`reduction` is ``'none'``, the unreduced loss is returned.
Default is ``'mean'``.
Returns:
The tensor variable storing the MSE loss of input and label.
Return type:
Variable.
Examples: Examples:
.. code-block:: python .. code-block:: python
import numpy as np import numpy as np
import paddle import paddle
from paddle import fluid from paddle import fluid
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册