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

Method forward

modules/VIPTRv2.py:563–572  ·  view source on GitHub ↗

x: B H W C

(self, x)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected