(self, x)
| 231 | return cls_tokens[:, 0] |
| 232 | |
| 233 | def forward(self, x): |
| 234 | x = self.forward_features(x) |
| 235 | if self.head_dist is not None: |
| 236 | x, x_dist = self.head(x[0]), self.head_dist(x[1]) # x must be a tuple |
| 237 | if self.training and not torch.jit.is_scripting(): |
| 238 | return x, x_dist |
| 239 | else: |
| 240 | return (x + x_dist) / 2 |
| 241 | else: |
| 242 | return self.head(x) |
| 243 | |
| 244 | |
| 245 | def checkpoint_filter_fn(state_dict, model): |
nothing calls this directly
no test coverage detected