code: def __init__(
      self,
      in_nc=3,
      config=None,
      dim=64,
      drop_path_rate=0.0,
      input_resolution=256,
  ):
      super(SCUNet, self).__init__()
      if config is None:
          config = [2, 2, 2, 2, 2, 2, 2]
      self.config = config
      self.dim = dim
      self.head_dim = 32
      self.window_size = 8
  
      # drop path rate for each layer
      dpr = [
          x.item()
          for x in torch.linspace(0, drop_path_rate, sum(config))
      ]
  
      self.m_head = [nn.Conv2d(in_nc, dim, 3, 1, 1, bias=False)]
  
      begin = 0
      self.m_down1 = [
          ConvTransBlock(
              dim // 2,
              dim // 2,
              self.head_dim,
              self.window_size,
              dpr[i + begin],
              "W" if not i % 2 else "SW",
              input_resolution,
          )
          for i in range(config[0])
      ] + [nn.Conv2d(dim, 2 * dim, 2, 2, 0, bias=False)]
  
      begin += config[0]
      self.m_down2 = [
          ConvTransBlock(
              dim,
              dim,
              self.head_dim,
              self.window_size,
              dpr[i + begin],
              "W" if not i % 2 else "SW",
              input_resolution // 2,
          )
          for i in range(config[1])
      ] + [nn.Conv2d(2 * dim, 4 * dim, 2, 2, 0, bias=False)]
  
      begin += config[1]
      self.m_down3 = [
          ConvTransBlock(
              2 * dim,
              2 * dim,
              self.head_dim,
              self.window_size,
              dpr[i + begin],
              "W" if not i % 2 else "SW",
              input_resolution // 4,
          )
          for i in range(config[2])
      ] + [nn.Conv2d(4 * dim, 8 * dim, 2, 2, 0, bias=False)]
  
      begin += config[2]
      self.m_body = [
          ConvTransBlock(
              4 * dim,
              4 * dim,
              self.head_dim,
              self.window_size,
              dpr[i + begin],
              "W" if not i % 2 else "SW",
              input_resolution // 8,
          )
          for i in range(config[3])
      ]
  
      begin += config[3]
      self.m_up3 = [
          nn.ConvTranspose2d(8 * dim, 4 * dim, 2, 2, 0, bias=False),
      ] + [
          ConvTransBlock(
              2 * dim,
              2 * dim,
              self.head_dim,
              self.window_size,
              dpr[i + begin],
              "W" if not i % 2 else "SW",
              input_resolution // 4,
          )
          for i in range(config[4])
      ]
  
      begin += config[4]
      self.m_up2 = [
          nn.ConvTranspose2d(4 * dim, 2 * dim, 2, 2, 0, bias=False),
      ] + [
          ConvTransBlock(
              dim,
              dim,
              self.head_dim,
              self.window_size,
              dpr[i + begin],
              "W" if not i % 2 else "SW",
              input_resolution // 2,
          )
          for i in range(config[5])
      ]
  
      begin += config[5]
      self.m_up1 = [
          nn.ConvTranspose2d(2 * dim, dim, 2, 2, 0, bias=False),
      ] + [
          ConvTransBlock(
              dim // 2,
              dim // 2,
              self.head_dim,
              self.window_size,
              dpr[i + begin],
              "W" if not i % 2 else "SW",
              input_resolution,
          )
          for i in range(config[6])
      ]
  
      self.m_tail = [nn.Conv2d(dim, in_nc, 3, 1, 1, bias=False)]
  
      self.m_head = nn.Sequential(*self.m_head)
      self.m_down1 = nn.Sequential(*self.m_down1)
      self.m_down2 = nn.Sequential(*self.m_down2)
      self.m_down3 = nn.Sequential(*self.m_down3)
      self.m_body = nn.Sequential(*self.m_body)
      self.m_up3 = nn.Sequential(*self.m_up3)
      self.m_up2 = nn.Sequential(*self.m_up2)
      self.m_up1 = nn.Sequential(*self.m_up1)
      self.m_tail = nn.Sequential(*self.m_tail)
  
imports: import numpy
  import torch
  import torch.nn
  from einops import rearrange
  from einops.layers.torch import Rearrange
  from timm.models.layers import trunc_normal_, DropPath
label_desc: Use image node_id 1 to create a new SCUNet object from inherited base classes: nn with example: obj = SCUNet(in_nc, config, dim, drop_path_rate, input_resolution)