MCPcopy Create free account
hub / github.com/buaacxf/VIPTR / forward

Method forward

modules/VIPTRv2T_ch.py:504–513  ·  view source on GitHub ↗

x: B H W C

(self, x)

Source from the content-addressed store, hash-verified

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
515class 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.,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected