(self, x)
| 356 | self.norm = None |
| 357 | |
| 358 | def forward(self, x): |
| 359 | B, C, H, W = x.shape |
| 360 | |
| 361 | x = self.proj(x) |
| 362 | H, W = x.shape[2:] |
| 363 | x = x.flatten(2).transpose(1, 2) # B Ph*Pw C |
| 364 | if self.norm is not None: |
| 365 | x = self.norm(x) |
| 366 | return x, H, W |
| 367 | |
| 368 | def flops(self): |
| 369 | Ho, Wo = self.patches_resolution |
nothing calls this directly
no outgoing calls
no test coverage detected