(self, x)
| 314 | |
| 315 | |
| 316 | def forward(self, x): |
| 317 | conv0 = self.conv0(x) |
| 318 | conv1 = self.conv1(conv0) |
| 319 | conv2 = self.conv2(conv1) |
| 320 | |
| 321 | intra_feat = conv2 |
| 322 | outputs = {} |
| 323 | |
| 324 | out = self.out1(intra_feat) |
| 325 | # outputs["stage1"] = out |
| 326 | outputs["stage1"],outputs["stage1_c"]= out.split([out.shape[1]//2,out.shape[1]//2],1) |
| 327 | |
| 328 | intra_feat = F.interpolate(intra_feat, scale_factor=2, mode="nearest") + self.inner1(conv1) |
| 329 | out = self.out2(intra_feat) |
| 330 | # outputs["stage2"] = out |
| 331 | outputs["stage2"],outputs["stage2_c"]= out.split([out.shape[1]//2,out.shape[1]//2],1) |
| 332 | |
| 333 | intra_feat = F.interpolate(intra_feat, scale_factor=2, mode="nearest") + self.inner2(conv0) |
| 334 | out = self.out3(intra_feat) |
| 335 | # outputs["stage3"] = out |
| 336 | outputs["stage3"],outputs["stage3_c"]= out.split([out.shape[1]//2,out.shape[1]//2],1) |
| 337 | |
| 338 | |
| 339 | |
| 340 | return outputs |
| 341 | |
| 342 | class CostRegNet(nn.Module): |
| 343 | def __init__(self, in_channels, base_channels,stage=0): |
nothing calls this directly
no outgoing calls
no test coverage detected