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

Minor fix to `MSELoss` docstring (#24077)

* Indent MSELoss example docs

* Point out input tensors should be of same shape

test=develop

* Document `MSELoss` input and return parameters

test=develop,test=document_fix
上级 3d744162
......@@ -155,17 +155,27 @@ class MSELoss(fluid.dygraph.layers.Layer):
.. math::
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:
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,
could be 'none' | 'mean' | 'sum'.
'none': no reduction will be applied
'mean': the output will be averaged
'sum': the output will be summed
If :attr:`reduction` is ``'mean'``, the reduced mean loss is returned.
If :attr:`size_average` is ``'sum'``, the reduced sum loss is returned.
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:
.. code-block:: python
import numpy as np
import paddle
from paddle import fluid
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册