Method
__init__
(self, normalized_shape, eps=1e-5)
Source from the content-addressed store, hash-verified
| 74 | |
| 75 | class LayerNorm(nn.Module): |
| 76 | def __init__(self, normalized_shape, eps=1e-5): |
| 77 | super().__init__() |
| 78 | self.normalized_shape = normalized_shape |
| 79 | self.eps = eps |
| 80 | self.weight = nn.Parameter(torch.ones(normalized_shape)) |
| 81 | self.bias = nn.Parameter(torch.zeros(normalized_shape)) |
| 82 | |
| 83 | def forward(self, x): |
| 84 | mean = x.mean(-1, keepdim=True) |
Callers
nothing calls this directly
Tested by
no test coverage detected