(self, x, hw_shape)
| 352 | init_cfg=None) |
| 353 | |
| 354 | def forward(self, x, hw_shape): |
| 355 | |
| 356 | def _inner_forward(x): |
| 357 | identity = x |
| 358 | x = self.norm1(x) |
| 359 | x = self.attn(x, hw_shape) |
| 360 | |
| 361 | x = x + identity |
| 362 | |
| 363 | identity = x |
| 364 | x = self.norm2(x) |
| 365 | x = self.ffn(x, identity=identity) |
| 366 | |
| 367 | return x |
| 368 | |
| 369 | if self.with_cp and x.requires_grad: |
| 370 | x = cp.checkpoint(_inner_forward, x) |
| 371 | else: |
| 372 | x = _inner_forward(x) |
| 373 | |
| 374 | return x |
| 375 | |
| 376 | |
| 377 | class SwinBlockSequence(BaseModule): |
nothing calls this directly
no outgoing calls
no test coverage detected