Skip to content

Commit 6529481

Browse files
authored
[API compatibility]update doc of LayerNorm (#7644)
* [API compatibility]update doc of LayerNorm * update:format * update:fix error
1 parent d22ab40 commit 6529481

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/api/paddle/nn/LayerNorm_cn.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
LayerNorm
44
-------------------------------
55

6-
.. py:class:: paddle.nn.LayerNorm(normalized_shape, epsilon=1e-05, weight_attr=None, bias_attr=None, name=None)
6+
.. py:class:: paddle.nn.LayerNorm(normalized_shape, epsilon=1e-05, *, elementwise_affine=True, bias=True, device=None, dtype=None, weight_attr=None, bias_attr=None, name=None)
77
88
构建 ``LayerNorm`` 类的一个可调用对象,具体用法参照 ``代码示例``。其中实现了层归一化层(Layer Normalization Layer)的功能,其可以应用于小批量输入数据。更多详情请参考:`Layer Normalization <https://arxiv.org/pdf/1607.06450v1.pdf>`_ 。
99

@@ -28,9 +28,21 @@ LayerNorm
2828

2929
- **normalized_shape** (int|list|tuple) – 需规范化的 shape,期望的输入 shape 为 ``[*, normalized_shape[0], normalized_shape[1], ..., normalized_shape[-1]]`` 。如果是单个整数,则此模块将在最后一个维度上规范化(此时最后一维的维度需与该参数相同)。
3030
- **epsilon** (float,可选) - 指明在计算过程中是否添加较小的值到方差中以防止除零。默认值:1e-05。
31+
``别名: eps``
32+
- **elementwise_affine** (bool,可选) - 该模块是否具有可学习的仿射参数(weight 和 bias)。如果设置为 False,将不会创建可学习的参数,无论 bias、weight_attr 和 bias_attr 如何设置。默认值:True。
33+
``注意: 此参数必须以关键字参数的形式传入``
34+
- **bias** (bool,可选) - 该模块是否具有可学习的偏置(bias)。如果设置为 False,将不会创建可学习的偏置,无论 bias_attr 如何设置。默认值:True。
35+
``注意: 此参数必须以关键字参数的形式传入``
36+
- **device** (PlaceLike,可选) - 计算发生的设备。默认值:None。
37+
``注意: 此参数必须以关键字参数的形式传入``
38+
- **dtype** (DTypeLike,可选) - 权重和偏置的数据类型。默认值:None。
39+
``注意: 此参数必须以关键字参数的形式传入``
3140
- **weight_attr** (ParamAttr|bool|None, 可选) - 用于指定可训练的增益参数 :math:`g` 的属性。如果为 False,则不使用权重(即权重参数为 None);如果为 None,则会使用一个默认的 ParamAttr 作为权重的属性设置,该属性将权重初始化为 1。默认值为 None,表示使用默认的权重属性。具体用法请参见 :ref:`cn_api_paddle_ParamAttr`。
41+
``注意: 此参数必须以关键字参数的形式传入``
3242
- **bias_attr** (ParamAttr|bool|None, 可选) - 用于指定可训练的偏置参数 :math:`b` 的属性。如果为 False,则不使用偏置(即偏置参数为 None);如果为 None,则会使用一个默认的 ParamAttr 作为偏置的属性设置,该属性将偏置初始化为 0。默认值为 None,表示使用默认的偏置属性。具体用法请参见 :ref:`cn_api_paddle_ParamAttr`。
43+
``注意: 此参数必须以关键字参数的形式传入``
3344
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。
45+
``注意: 此参数必须以关键字参数的形式传入``
3446

3547
形状
3648
::::::::::::

0 commit comments

Comments
 (0)