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

Method __init__

modules/VIPTRv2T_ch.py:740–761  ·  view source on GitHub ↗
(self, in_chans=3, embed_dim=96, norm_layer=None)

Source from the content-addressed store, hash-verified

738
739class PatchEmbed(nn.Module):
740 def __init__(self, in_chans=3, embed_dim=96, norm_layer=None):
741 super().__init__()
742
743 self.embed_dim = embed_dim
744 self.proj = nn.Sequential(
745 ConvBNLayer(
746 in_channels=in_chans,
747 out_channels=embed_dim // 2,
748 kernel_size=3,
749 stride=2,
750 padding=1,
751 act=nn.GELU,
752 bias_attr=False),
753 ConvBNLayer(
754 in_channels=embed_dim // 2,
755 out_channels=embed_dim,
756 kernel_size=3,
757 stride=2,
758 padding=1,
759 act=nn.GELU,
760 bias_attr=False)
761 )
762
763 def forward(self, x):
764 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