mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Update
This commit is contained in:
@ -4,9 +4,9 @@ from typing import Optional, Union
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
from torch import Size, Tensor
|
from torch import Size, Tensor
|
||||||
from torch.nn import functional as F, init
|
|
||||||
from torch.nn.modules._nn_docs import layernorm_args, common_args
|
|
||||||
from torch._C import _add_docstr as add_docstr
|
from torch._C import _add_docstr as add_docstr
|
||||||
|
from torch.nn import functional as F, init
|
||||||
|
from torch.nn.modules._nn_docs import common_args, layernorm_args
|
||||||
from torch.nn.parameter import Parameter
|
from torch.nn.parameter import Parameter
|
||||||
|
|
||||||
from ._functions import CrossMapLRN2d as _cross_map_lrn2d
|
from ._functions import CrossMapLRN2d as _cross_map_lrn2d
|
||||||
@ -125,13 +125,12 @@ class LayerNorm(Module):
|
|||||||
{layernorm_args}
|
{layernorm_args}
|
||||||
{common_args}
|
{common_args}
|
||||||
|
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
weight: the learnable weights of the module of shape
|
weight: the learnable weights of the module of shape
|
||||||
:math:`\text{{normalized\_shape}}` when :attr:`elementwise_affine` is set to ``True``.
|
:math:`\\text{{normalized\\_shape}}` when :attr:`elementwise_affine` is set to ``True``.
|
||||||
The values are initialized to 1.
|
The values are initialized to 1.
|
||||||
bias: the learnable bias of the module of shape
|
bias: the learnable bias of the module of shape
|
||||||
:math:`\text{{normalized\_shape}}` when :attr:`elementwise_affine` is set to ``True``.
|
:math:`\\text{{normalized\\_shape}}` when :attr:`elementwise_affine` is set to ``True``.
|
||||||
The values are initialized to 0.
|
The values are initialized to 0.
|
||||||
|
|
||||||
Shape:
|
Shape:
|
||||||
@ -159,8 +158,7 @@ class LayerNorm(Module):
|
|||||||
:scale: 50 %
|
:scale: 50 %
|
||||||
|
|
||||||
""".format(
|
""".format(
|
||||||
layernorm_args=layernorm_args.__doc__,
|
layernorm_args=layernorm_args.__doc__, common_args=common_args.__doc__
|
||||||
common_args=common_args.__doc__
|
|
||||||
)
|
)
|
||||||
|
|
||||||
__constants__ = ["normalized_shape", "eps", "elementwise_affine"]
|
__constants__ = ["normalized_shape", "eps", "elementwise_affine"]
|
||||||
|
|||||||
Reference in New Issue
Block a user