x: B H W C
(self, x)
| 561 | self.norm = nn.LayerNorm(out_dim) |
| 562 | |
| 563 | def forward(self, x): |
| 564 | ''' |
| 565 | x: B H W C |
| 566 | ''' |
| 567 | x = x.permute(0, 3, 1, 2).contiguous() # (b c h w) |
| 568 | x = self.reduction(x) # (b oc oh ow) |
| 569 | x = x.permute(0, 2, 3, 1).contiguous() # (b oh ow oc) |
| 570 | x = self.norm(x) |
| 571 | |
| 572 | return x |
| 573 | |
| 574 | class LePEAttention(nn.Module): |
| 575 | def __init__(self, dim, resolution, idx, split_size=7, dim_out=None, num_heads=8, attn_drop=0., proj_drop=0., |
nothing calls this directly
no outgoing calls
no test coverage detected