(self, normalized_shape, eps=1e-05, affine=True, **kwargs)
| 174 | """ |
| 175 | |
| 176 | def __init__(self, normalized_shape, eps=1e-05, affine=True, **kwargs): |
| 177 | super().__init__(**kwargs) |
| 178 | if isinstance(normalized_shape, int): |
| 179 | normalized_shape = (normalized_shape,) |
| 180 | self.normalized_shape = tuple(normalized_shape) |
| 181 | self.eps = eps |
| 182 | self.affine = affine |
| 183 | if self.affine: |
| 184 | self.weight = Parameter(np.ones(self.normalized_shape, dtype="float32")) |
| 185 | self.bias = Parameter(np.zeros(self.normalized_shape, dtype="float32")) |
| 186 | else: |
| 187 | self.weight = None |
| 188 | self.bias = None |
| 189 | |
| 190 | self.reset_parameters() |
| 191 | |
| 192 | def reset_parameters(self): |
| 193 | if self.affine: |
nothing calls this directly
no test coverage detected