MCPcopy Create free account
hub / github.com/microsoft/Cream / __init__

Method __init__

TinyViT/models/tiny_vit.py:126–135  ·  view source on GitHub ↗
(self, input_resolution, dim, out_dim, activation)

Source from the content-addressed store, hash-verified

124
125class PatchMerging(nn.Module):
126 def __init__(self, input_resolution, dim, out_dim, activation):
127 super().__init__()
128
129 self.input_resolution = input_resolution
130 self.dim = dim
131 self.out_dim = out_dim
132 self.act = activation()
133 self.conv1 = Conv2d_BN(dim, out_dim, 1, 1, 0)
134 self.conv2 = Conv2d_BN(out_dim, out_dim, 3, 2, 1, groups=out_dim)
135 self.conv3 = Conv2d_BN(out_dim, out_dim, 1, 1, 0)
136
137 def forward(self, x):
138 if x.ndim == 3:

Callers

nothing calls this directly

Calls 2

Conv2d_BNClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected