x: B H W C
(self, x)
| 502 | self.norm = nn.LayerNorm(out_dim) |
| 503 | |
| 504 | def forward(self, x): |
| 505 | ''' |
| 506 | x: B H W C |
| 507 | ''' |
| 508 | x = x.permute(0, 3, 1, 2).contiguous() # (b c h w) |
| 509 | x = self.reduction(x) # (b oc oh ow) |
| 510 | x = x.permute(0, 2, 3, 1).contiguous() # (b oh ow oc) |
| 511 | x = self.norm(x) |
| 512 | |
| 513 | return x |
| 514 | |
| 515 | class LePEAttention(nn.Module): |
| 516 | 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