class_docstr: Upsampling (by either bilinear interpolation or transpose convolutions) followed by concatenation of feature map
  from contracting path, followed by double 3x3 convolution.
  
  >>> Up(8, 4)  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
  Up(
    (upsample): ConvTranspose2d(8, 4, kernel_size=(2, 2), stride=(2, 2))
    (conv): DoubleConv(
      (net): Sequential(...)
    )
  )
class_docstr_tok: ["Upsampling","(","by","either","bilinear","interpolation","or","transpose","convolutions",")","followed","by","concatenation","of","feature","map","from","contracting","path",",","followed","by","double","3x3","convolution",".",">",">",">","Up","(","8",",","4",")","#","doctest",":","+ELLIPSIS","+NORMALIZE_WHITESPACE","Up","(","(","upsample",")",":","ConvTranspose2d","(","8",",","4",",","kernel_size=","(","2",",","2",")",",","stride=","(","2",",","2",")",")","(","conv",")",":","DoubleConv","(","(","net",")",":","Sequential","(","...",")",")",")"]
code: def forward(self, x1, x2):
      x1 = self.upsample(x1)
  
      # Pad x1 to the size of x2
      diff_h = x2.shape[2] - x1.shape[2]
      diff_w = x2.shape[3] - x1.shape[3]
  
      x1 = F.pad(
          x1,
          [
              diff_w // 2,
              diff_w - diff_w // 2,
              diff_h // 2,
              diff_h - diff_h // 2,
          ],
      )
  
      # Concatenate along the channels axis
      x = torch.cat([x2, x1], dim=1)
      return self.conv(x)
  
imports: import os
  import random
  from argparse import ArgumentParser, Namespace
  import numpy
  import torch
  import torch.nn.functional
  import torchvision.transforms
  from lightning.pytorch import LightningModule, Trainer, cli_lightning_logo
  from PIL import Image
  from torch import nn
  from torch.utils.data import DataLoader, Dataset
label_desc: Use image node_id 2 for calling the Up obj's underlying member method code with example usage: obj.forward(x1, x2) and returns: self