Merge pull request #109 from ant-Korn/save_to_onnx

Corrected class Up for model to ONNX exporting

Former-commit-id: 060bdcd69886a3082a6f8fb7746e12d5fca3e360
This commit is contained in:
milesial 2019-12-29 20:02:03 +01:00 committed by GitHub
commit d081192e90

View file

@ -54,8 +54,8 @@ class Up(nn.Module):
def forward(self, x1, x2):
x1 = self.up(x1)
# input is CHW
diffY = x2.size()[2] - x1.size()[2]
diffX = x2.size()[3] - x1.size()[3]
diffY = torch.tensor([x2.size()[2] - x1.size()[2]])
diffX = torch.tensor([x2.size()[3] - x1.size()[3]])
x1 = F.pad(x1, [diffX // 2, diffX - diffX // 2,
diffY // 2, diffY - diffY // 2])