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

Method __init__

modules/VIPTRv2.py:917–938  ·  view source on GitHub ↗
(self, in_chans=3, embed_dim=96, norm_layer=None)

Source from the content-addressed store, hash-verified

915
916class PatchEmbed(nn.Module):
917 def __init__(self, in_chans=3, embed_dim=96, norm_layer=None):
918 super().__init__()
919
920 self.embed_dim = embed_dim
921 self.proj = nn.Sequential(
922 ConvBNLayer(
923 in_channels=in_chans,
924 out_channels=embed_dim // 2,
925 kernel_size=3,
926 stride=2,
927 padding=1,
928 act=nn.GELU,
929 bias_attr=False),
930 ConvBNLayer(
931 in_channels=embed_dim // 2,
932 out_channels=embed_dim,
933 kernel_size=3,
934 stride=2,
935 padding=1,
936 act=nn.GELU,
937 bias_attr=False)
938 )
939
940 def forward(self, x):
941 x = self.proj(x).permute(0, 2, 3, 1).contiguous()

Callers

nothing calls this directly

Calls 2

ConvBNLayerClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected