(self, m)
| 1004 | self.apply(self._init_weights) |
| 1005 | |
| 1006 | def _init_weights(self, m): |
| 1007 | if isinstance(m, nn.Linear): |
| 1008 | trunc_normal_(m.weight, std=.02) |
| 1009 | if isinstance(m, nn.Linear) and m.bias is not None: |
| 1010 | nn.init.constant_(m.bias, 0) |
| 1011 | elif isinstance(m, (nn.LayerNorm, nn.BatchNorm2d)): |
| 1012 | try: |
| 1013 | nn.init.constant_(m.bias, 0) |
| 1014 | nn.init.constant_(m.weight, 1.0) |
| 1015 | except: |
| 1016 | pass |
| 1017 | |
| 1018 | def forward_features(self, x): |
| 1019 | x = self.patch_embed(x) |
nothing calls this directly
no outgoing calls
no test coverage detected