(self, x)
| 152 | return nn.Sequential(*layers) |
| 153 | |
| 154 | def forward(self, x): |
| 155 | x1, x2 = torch.split(x, [1, 2], dim=1) |
| 156 | x1 = self.conv1_v1(x1) |
| 157 | x2 = self.conv1_v2(x2) |
| 158 | x = torch.cat([x1, x2], dim=1) |
| 159 | x = self.bn1(x) |
| 160 | x = self.relu(x) |
| 161 | x = self.maxpool(x) |
| 162 | |
| 163 | x = self.layer1(x) |
| 164 | x = self.layer2(x) |
| 165 | x = self.layer3(x) |
| 166 | x = self.layer4(x) |
| 167 | x = self.avgpool(x) |
| 168 | x = x.view(x.size(0), -1) |
| 169 | |
| 170 | feat_dim = x.shape[1] |
| 171 | x1, x2 = torch.split(x, [feat_dim // 2, feat_dim // 2], dim=1) |
| 172 | |
| 173 | return x1, x2 |
| 174 | |
| 175 | |
| 176 | def resnet18(pretrained=False, **kwargs): |
nothing calls this directly
no outgoing calls
no test coverage detected