(self, m)
| 942 | self.apply(self._init_weights) |
| 943 | |
| 944 | def _init_weights(self, m): |
| 945 | if isinstance(m, nn.Linear): |
| 946 | trunc_normal_(m.weight, std=.02) |
| 947 | if isinstance(m, nn.Linear) and m.bias is not None: |
| 948 | nn.init.constant_(m.bias, 0) |
| 949 | elif isinstance(m, (nn.LayerNorm, nn.BatchNorm2d)): |
| 950 | try: |
| 951 | nn.init.constant_(m.bias, 0) |
| 952 | nn.init.constant_(m.weight, 1.0) |
| 953 | except: |
| 954 | pass |
| 955 | |
| 956 | def forward_features(self, x): |
| 957 | x = self.patch_embed(x) |
nothing calls this directly
no outgoing calls
no test coverage detected