Skip to content

Commit 3a025b6

Browse files
author
zhangkaihuo
authored
fix typo (#4105)
* fix typo * fix typo * fix ffn doc * fix ffn doc * fix typo
1 parent 79874e0 commit 3a025b6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

docs/api/paddle/incubate/nn/functional/fused_feedforward_cn.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ fused_feedforward
1212
residual = src;
1313
if pre_layer_norm:
1414
src = layer_norm(src)
15-
src = linear(dropout(activation(dropout(linear(src)))))
15+
src = linear(dropout(activation(linear(src))))
16+
src = residual + dropout(src)
1617
if not pre_layer_norm:
17-
src = layer_norm(out)
18+
src = layer_norm(src)
1819
1920
参数
2021
:::::::::
@@ -24,12 +25,12 @@ fused_feedforward
2425
- **linear1_bias** (Tensor, 可选) - 第一个linear算子的偏置数据,数据类型与 ``x`` 一样,形状是 ``[dim_feedforward]`` 。默认值为None。
2526
- **linear2_bias** (Tensor, 可选) - 第二个linear算子的偏置数据,数据类型与 ``x`` 一样,形状是 ``[d_model]`` 。默认值为None。
2627
- **ln1_scale** (Tensor, 可选) - 第一个layer_norm算子的权重数据,数据类型可以是float32或者float64,形状和 ``x`` 一样。默认值为None。
27-
- **ln1_bias** (Tensor, 可选) - 第一个layer_norm算子的偏置数据,数据类型和 ``ln1_scale`` 一样, 形状是 ``[d_model]`` 。默认值为None。
28+
- **ln1_bias** (Tensor, 可选) - 第一个layer_norm算子的偏置数据,数据类型和 ``ln1_scale`` 一样, 形状是 ``x.shape[-1]`` 。默认值为None。
2829
- **ln2_scale** (Tensor, 可选) - 第二个layer_norm算子的权重数据,数据类型可以是float32或者float64,形状和 ``x`` 一样。默认值为None。
29-
- **ln2_bias** (Tensor, 可选) - 第二个layer_norm算子的偏置数据,数据类型和 ``ln2_scale`` 一样, 形状是 ``[d_model]`` 。默认值为None。
30+
- **ln2_bias** (Tensor, 可选) - 第二个layer_norm算子的偏置数据,数据类型和 ``ln2_scale`` 一样, 形状是 ``x.shape[-1]`` 。默认值为None。
3031
- **dropout1_rate** (float, 可选) - 第一个dropout算子置零的概率。默认是0.5。
3132
- **dropout2_rate** (float, 可选) - 第二个dropout算子置零的概率。默认是0.5。
32-
- **activation** (string, 可选) - 激活函数。默认值是relu。
33+
- **activation** (string, 可选) - 激活函数,当前只支持relu和gelu。默认值是relu。
3334
- **ln1_epsilon** (float, 可选) - 一个很小的浮点数,被第一个layer_norm算子加到分母,避免出现除零的情况。默认值是1e-5。
3435
- **ln2_epsilon** (float, 可选) - 一个很小的浮点数,被第二个layer_norm算子加到分母,避免出现除零的情况。默认值是1e-5。
3536
- **pre_layer_norm** (bool, 可选) - 在预处理阶段加上layer_norm,或者在后处理阶段加上layer_norm。默认值是False。

0 commit comments

Comments
 (0)