def forward(self, x1, x2):
    if self.bilinear:
        x1 = nn.functional.interpolate(x1, scale_factor=2, mode='bilinear', align_corners=True)
    else:
        x1 = self.convtrans(x1)
    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))))
    x = torch.cat([x2, x1], dim=1)
    x = self.conv(x)
    return x
def forward(self, x1, x2):
    if self.bilinear:
        x1 = nn.functional.interpolate(x1, scale_factor=2, mode='bilinear', align_corners=True)
    else:
        x1 = self.convtrans(x1)
    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))))
    x = torch.cat([x2, x1], dim=1)
    x = self.conv(x)
    return x