|
27 | 27 | class _BatchNorm(ABC, nn.Module): |
28 | 28 | """Base class for batch normalization modules.""" |
29 | 29 |
|
30 | | - running_mean: Tensor | None |
31 | | - running_var: Tensor | None |
32 | 30 | weight: Tensor | None |
33 | 31 | bias: Tensor | None |
| 32 | + running_mean: Tensor | None |
| 33 | + running_var: Tensor | None |
34 | 34 | num_batches_tracked: Tensor | None |
35 | 35 |
|
36 | 36 | def __init__( |
@@ -192,6 +192,9 @@ def _check_input_dim(self, x: Tensor) -> None: |
192 | 192 |
|
193 | 193 | class GroupNorm(nn.Module): |
194 | 194 | """Apply group normalization over channel groups.""" |
| 195 | + |
| 196 | + weight: Tensor | None |
| 197 | + bias: Tensor | None |
195 | 198 |
|
196 | 199 | def __init__( |
197 | 200 | self, |
@@ -272,10 +275,10 @@ def extra_repr(self) -> str: |
272 | 275 | class _InstanceNorm(ABC, nn.Module): |
273 | 276 | """Base class for instance normalization modules.""" |
274 | 277 |
|
275 | | - running_mean: Tensor | None |
276 | | - running_var: Tensor | None |
277 | 278 | weight: Tensor | None |
278 | 279 | bias: Tensor | None |
| 280 | + running_mean: Tensor | None |
| 281 | + running_var: Tensor | None |
279 | 282 |
|
280 | 283 | def __init__( |
281 | 284 | self, |
@@ -416,6 +419,9 @@ def _check_input_dim(self, x: Tensor) -> None: |
416 | 419 | class LayerNorm(nn.Module): |
417 | 420 | """Apply layer normalization over the trailing input dimensions.""" |
418 | 421 |
|
| 422 | + weight: Tensor | None |
| 423 | + bias: Tensor | None |
| 424 | + |
419 | 425 | def __init__( |
420 | 426 | self, |
421 | 427 | normalized_shape: int | tuple[int, ...], |
@@ -545,6 +551,8 @@ def extra_repr(self) -> str: |
545 | 551 | class RMSNorm(nn.Module): |
546 | 552 | """Apply root mean square normalization over the trailing input dimensions.""" |
547 | 553 |
|
| 554 | + weight: Tensor | None |
| 555 | + |
548 | 556 | def __init__( |
549 | 557 | self, |
550 | 558 | normalized_shape: int | tuple[int, ...], |
|
0 commit comments