From ef14c0e8299ffa34bfa3974dda3e4d154d933928 Mon Sep 17 00:00:00 2001 From: HansBambel Date: Fri, 24 Apr 2020 15:57:53 +0200 Subject: [PATCH] diffX and diffY is now an int instead of a Tensor Former-commit-id: 342d4e0a8ca19bbee77256caeda0ef6537d746f8 --- unet/unet_parts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unet/unet_parts.py b/unet/unet_parts.py index 7c64dc1..cf092f3 100644 --- a/unet/unet_parts.py +++ b/unet/unet_parts.py @@ -57,8 +57,8 @@ class Up(nn.Module): def forward(self, x1, x2): x1 = self.up(x1) # input is CHW - diffY = torch.tensor([x2.size()[2] - x1.size()[2]]) - diffX = torch.tensor([x2.size()[3] - x1.size()[3]]) + diffY = x2.size()[2] - x1.size()[2] + diffX = x2.size()[3] - x1.size()[3] x1 = F.pad(x1, [diffX // 2, diffX - diffX // 2, diffY // 2, diffY - diffY // 2])