(self, m)
| 435 | rescale(layer.mlp.fc2.weight.data, layer_id + 1) |
| 436 | |
| 437 | def _init_weights(self, m): |
| 438 | if isinstance(m, nn.Linear): |
| 439 | trunc_normal_(m.weight, std=.02) |
| 440 | if isinstance(m, nn.Linear) and m.bias is not None: |
| 441 | nn.init.constant_(m.bias, 0) |
| 442 | elif isinstance(m, nn.LayerNorm): |
| 443 | nn.init.constant_(m.bias, 0) |
| 444 | nn.init.constant_(m.weight, 1.0) |
| 445 | |
| 446 | @staticmethod |
| 447 | def _normalization(x): |
nothing calls this directly
no outgoing calls
no test coverage detected