LayerNorm
Function
Normalize all features of a single sample.
Prototype
torch.nn.LayerNorm(
normalized_shape: Union[int, List[int], torch.Size],
eps: float = 1e-5,
elementwise_affine: bool = True,
device=None,
dtype=None
)
Parameters
Parameter |
Type |
Mandatory (Yes/No) |
Description |
|---|---|---|---|
normalized_shape |
int/list/tuple |
Yes |
Shape to be normalized (for example, [C, H, W] or hidden_size) |
eps |
float |
No |
Numerical stability constant (default value: 1e-5) |
elementwise_affine |
bool |
No |
Whether to learn γ and β element-wise (default value: True) |
Parent topic: Operator Interfaces