未验证 提交 a3db159c 编写于 作者: M Mr.Juice 提交者: GitHub

Fix docs 修复第七轮第一组文档问题 (#51506)

* fix docs 第七轮第一组

* fix docs 第七轮第一组
上级 5a39365a
......@@ -371,7 +371,7 @@ class ClipGradByValue(ClipGradBase):
Args:
max (float): The maximum value to clip by.
min (float, optional): The minimum value to clip by. if not set by user, it will be set to ``-max``
automatically. In this case, ``max`` must be greater than 0.
automatically. In this case, ``max`` must be greater than :math:`0`.
Examples:
.. code-block:: python
......
......@@ -1730,7 +1730,7 @@ def zeropad2d(x, padding, data_format="NCHW", name=None):
data_format(str, optional): An string from: "NHWC", "NCHW". Specify the data format of
the input data. Default: "NCHW".
name(str, optional): The default value is None. Normally there is no need for user
to set this property.
to set this property. For more information, please refer to :ref:`api_guide_Name`.
Returns:
Tensor, padded with 0 according to pad and data type is same as input.
......@@ -1739,12 +1739,11 @@ def zeropad2d(x, padding, data_format="NCHW", name=None):
.. code-block:: python
import paddle
import numpy as np
import paddle.nn.functional as F
x_shape = (1, 1, 2, 3)
x = paddle.arange(np.prod(x_shape), dtype="float32").reshape(x_shape) + 1
x_shape = paddle.to_tensor([1, 1, 2, 3])
x = paddle.arange(paddle.prod(x_shape), dtype="float32").reshape(x_shape) + 1
y = F.zeropad2d(x, [1, 2, 1, 1])
print(y)
# [[[[0. 0. 0. 0. 0. 0.]
# [0. 1. 2. 3. 0. 0.]
# [0. 4. 5. 6. 0. 0.]
......
......@@ -1224,7 +1224,7 @@ class BiRNN(Layer):
Parameters:
cell_fw (RNNCellBase): A RNNCellBase instance used for forward RNN.
cell_bw (RNNCellBase): A RNNCellBase instance used for backward RNN.
time_major (bool): Whether the first dimension of the input means the
time_major (bool, optional): Whether the first dimension of the input means the
time steps. Defaults to False.
Inputs:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册