(self, m)
| 407 | rescale(layer.mlp.fc2.weight.data, layer_id + 1) |
| 408 | |
| 409 | def _init_weights(self, m): |
| 410 | if isinstance(m, nn.Linear): |
| 411 | trunc_normal_(m.weight, std=.02) |
| 412 | if isinstance(m, nn.Linear) and m.bias is not None: |
| 413 | nn.init.constant_(m.bias, 0) |
| 414 | elif isinstance(m, nn.LayerNorm): |
| 415 | nn.init.constant_(m.bias, 0) |
| 416 | nn.init.constant_(m.weight, 1.0) |
| 417 | |
| 418 | @staticmethod |
| 419 | def _normalization(x): |
nothing calls this directly
no outgoing calls
no test coverage detected