(self, x, hw_shape)
| 336 | self.stride = stride |
| 337 | |
| 338 | def forward(self, x, hw_shape): |
| 339 | b, n, c = x.shape |
| 340 | h, w = hw_shape |
| 341 | feat_token = x |
| 342 | cnn_feat = feat_token.transpose(1, 2).view(b, c, h, w) |
| 343 | if self.stride == 1: |
| 344 | x = self.proj(cnn_feat) + cnn_feat |
| 345 | else: |
| 346 | x = self.proj(cnn_feat) |
| 347 | x = x.flatten(2).transpose(1, 2) |
| 348 | return x |
| 349 | |
| 350 | |
| 351 | @BACKBONES.register_module() |
nothing calls this directly
no outgoing calls
no test coverage detected