(self, m)
| 289 | self.apply(self._init_weights) |
| 290 | |
| 291 | def _init_weights(self, m): |
| 292 | if isinstance(m, nn.Linear): |
| 293 | trunc_normal_(m.weight, std=.02) |
| 294 | if isinstance(m, nn.Linear) and m.bias is not None: |
| 295 | nn.init.constant_(m.bias, 0) |
| 296 | elif isinstance(m, nn.LayerNorm): |
| 297 | nn.init.constant_(m.bias, 0) |
| 298 | nn.init.constant_(m.weight, 1.0) |
| 299 | |
| 300 | def interpolate_pos_encoding(self, x, w, h): |
| 301 | npatch = x.shape[1] |
nothing calls this directly
no test coverage detected