Skip to content

Commit 15f39b7

Browse files
authored
Merge pull request #13978 from sneaxiy/release/1.0.0
Cherry-pick #13944 to release/1.0.0
2 parents e9c9088 + 9e33213 commit 15f39b7

File tree

1 file changed

+16
-7
lines changed
  • python/paddle/fluid/layers

1 file changed

+16
-7
lines changed

python/paddle/fluid/layers/nn.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2302,19 +2302,28 @@ def layer_norm(input,
23022302
Args:
23032303
input(Variable): The input tensor variable.
23042304
scale(bool): Whether to learn the adaptive gain :math:`g` after
2305-
normalization.
2305+
normalization. Default True.
23062306
shift(bool): Whether to learn the adaptive bias :math:`b` after
2307-
normalization.
2308-
begin_norm_axis(bool): The normalization will be performed along
2307+
normalization. Default True.
2308+
begin_norm_axis(int): The normalization will be performed along
23092309
dimensions from :attr:`begin_norm_axis` to :attr:`rank(input)`.
2310+
Default 1.
23102311
epsilon(float): The small value added to the variance to prevent
2311-
division by zero.
2312+
division by zero. Default 1e-05.
23122313
param_attr(ParamAttr|None): The parameter attribute for the learnable
2313-
gain :math:`g`.
2314+
gain :math:`g`. If :attr:`scale` is False, :attr:`param_attr` is
2315+
omitted. If :attr:`scale` is True and :attr:`param_attr` is None,
2316+
a default :code:`ParamAttr` would be added as scale. The
2317+
:attr:`param_attr` is initialized as 1 if it is added. Default None.
23142318
bias_attr(ParamAttr|None): The parameter attribute for the learnable
2315-
bias :math:`b`.
2319+
bias :math:`b`. If :attr:`shift` is False, :attr:`bias_attr` is
2320+
omitted. If :attr:`shift` is True and :attr:`param_attr` is None,
2321+
a default :code:`ParamAttr` would be added as bias. The
2322+
:attr:`bias_attr` is initialized as 0 if it is added. Default None.
23162323
act(str): Activation to be applied to the output of layer normalizaiton.
2317-
name (str): The name of this layer. It is optional.
2324+
Default None.
2325+
name(str): The name of this layer. It is optional. Default None, and a
2326+
unique name would be generated automatically.
23182327
23192328
Returns:
23202329
${y_comment}

0 commit comments

Comments
 (0)