code: def __init__(
      self,
      in_nc=3,
      out_nc=3,
      nc=[64, 128, 256, 512],
      nb=4,
      act_mode="R",
      downsample_mode="strideconv",
      upsample_mode="convtranspose",
  ):
      super(FBCNN, self).__init__()
  
      self.m_head = conv(in_nc, nc[0], bias=True, mode="C")
      self.nb = nb
      self.nc = nc
      # downsample
      if downsample_mode == "avgpool":
          downsample_block = downsample_avgpool
      elif downsample_mode == "maxpool":
          downsample_block = downsample_maxpool
      elif downsample_mode == "strideconv":
          downsample_block = downsample_strideconv
      else:
          raise NotImplementedError(
              "downsample mode [{:s}] is not found".format(
                  downsample_mode
              )
          )
  
      self.m_down1 = sequential(
          *[
              ResBlock(
                  nc[0], nc[0], bias=True, mode="C" + act_mode + "C"
              )
              for _ in range(nb)
          ],
          downsample_block(nc[0], nc[1], bias=True, mode="2"),
      )
      self.m_down2 = sequential(
          *[
              ResBlock(
                  nc[1], nc[1], bias=True, mode="C" + act_mode + "C"
              )
              for _ in range(nb)
          ],
          downsample_block(nc[1], nc[2], bias=True, mode="2"),
      )
      self.m_down3 = sequential(
          *[
              ResBlock(
                  nc[2], nc[2], bias=True, mode="C" + act_mode + "C"
              )
              for _ in range(nb)
          ],
          downsample_block(nc[2], nc[3], bias=True, mode="2"),
      )
  
      self.m_body_encoder = sequential(
          *[
              ResBlock(
                  nc[3], nc[3], bias=True, mode="C" + act_mode + "C"
              )
              for _ in range(nb)
          ]
      )
  
      self.m_body_decoder = sequential(
          *[
              ResBlock(
                  nc[3], nc[3], bias=True, mode="C" + act_mode + "C"
              )
              for _ in range(nb)
          ]
      )
  
      # upsample
      if upsample_mode == "upconv":
          upsample_block = upsample_upconv
      elif upsample_mode == "pixelshuffle":
          upsample_block = upsample_pixelshuffle
      elif upsample_mode == "convtranspose":
          upsample_block = upsample_convtranspose
      else:
          raise NotImplementedError(
              "upsample mode [{:s}] is not found".format(upsample_mode)
          )
  
      self.m_up3 = nn.LayerList(
          [
              upsample_block(nc[3], nc[2], bias=True, mode="2"),
              *[
                  QFAttention(
                      nc[2], nc[2], bias=True, mode="C" + act_mode + "C"
                  )
                  for _ in range(nb)
              ],
          ]
      )
  
      self.m_up2 = nn.LayerList(
          [
              upsample_block(nc[2], nc[1], bias=True, mode="2"),
              *[
                  QFAttention(
                      nc[1], nc[1], bias=True, mode="C" + act_mode + "C"
                  )
                  for _ in range(nb)
              ],
          ]
      )
  
      self.m_up1 = nn.LayerList(
          [
              upsample_block(nc[1], nc[0], bias=True, mode="2"),
              *[
                  QFAttention(
                      nc[0], nc[0], bias=True, mode="C" + act_mode + "C"
                  )
                  for _ in range(nb)
              ],
          ]
      )
  
      self.m_tail = conv(nc[0], out_nc, bias=True, mode="C")
  
      self.qf_pred = sequential(
          *[
              ResBlock(
                  nc[3], nc[3], bias=True, mode="C" + act_mode + "C"
              )
              for _ in range(nb)
          ],
          nn.AdaptiveAvgPool2D((1, 1)),
          nn.Flatten(),
          nn.Linear(512, 512),
          nn.ReLU(),
          nn.Linear(512, 512),
          nn.ReLU(),
          nn.Linear(512, 1),
          nn.Sigmoid(),
      )
  
      self.qf_embed = sequential(
          nn.Linear(1, 512),
          nn.ReLU(),
          nn.Linear(512, 512),
          nn.ReLU(),
          nn.Linear(512, 512),
          nn.ReLU(),
      )
  
      self.to_gamma_3 = sequential(nn.Linear(512, nc[2]), nn.Sigmoid())
      self.to_beta_3 = sequential(nn.Linear(512, nc[2]), nn.Tanh())
      self.to_gamma_2 = sequential(nn.Linear(512, nc[1]), nn.Sigmoid())
      self.to_beta_2 = sequential(nn.Linear(512, nc[1]), nn.Tanh())
      self.to_gamma_1 = sequential(nn.Linear(512, nc[0]), nn.Sigmoid())
      self.to_beta_1 = sequential(nn.Linear(512, nc[0]), nn.Tanh())
  
imports: from collections import OrderedDict
  import numpy
  import paddle.nn
label_desc: Use image node_id 1 to create a new FBCNN object from inherited base classes: nn with example: obj = FBCNN(in_nc, out_nc, nc, nb, act_mode, downsample_mode, upsample_mode)