code: def __init__(
      self,
      in_nc,
      out_nc,
      nf,
      nb,
      nr=3,
      gc=32,
      upscale=4,
      norm_type=None,
      act_type="leakyrelu",
      mode="CNA",
      upsample_mode="upconv",
      convtype="Conv2D",
      finalact=None,
      gaussian_noise=False,
      plus=False,
  ):
      super(RRDBNet, self).__init__()
      n_upscale = int(math.log(upscale, 2))
      if upscale == 3:
          n_upscale = 1
  
      self.resrgan_scale = 0
      if in_nc % 16 == 0:
          self.resrgan_scale = 1
      elif in_nc != 4 and in_nc % 4 == 0:
          self.resrgan_scale = 2
  
      fea_conv = conv_block(
          in_nc,
          nf,
          kernel_size=3,
          norm_type=None,
          act_type=None,
          convtype=convtype,
      )
      rb_blocks = [
          RRDB(
              nf,
              nr,
              kernel_size=3,
              gc=32,
              stride=1,
              bias=1,
              pad_type="zero",
              norm_type=norm_type,
              act_type=act_type,
              mode="CNA",
              convtype=convtype,
              gaussian_noise=gaussian_noise,
              plus=plus,
          )
          for _ in range(nb)
      ]
      LR_conv = conv_block(
          nf,
          nf,
          kernel_size=3,
          norm_type=norm_type,
          act_type=None,
          mode=mode,
          convtype=convtype,
      )
  
      if upsample_mode == "upconv":
          upsample_block = upconv_block
      elif upsample_mode == "pixelshuffle":
          upsample_block = pixelshuffle_block
      else:
          raise NotImplementedError(
              f"upsample mode [{upsample_mode}] is not found"
          )
      if upscale == 3:
          upsampler = upsample_block(
              nf, nf, 3, act_type=act_type, convtype=convtype
          )
      else:
          upsampler = [
              upsample_block(
                  nf, nf, act_type=act_type, convtype=convtype
              )
              for _ in range(n_upscale)
          ]
      HR_conv0 = conv_block(
          nf,
          nf,
          kernel_size=3,
          norm_type=None,
          act_type=act_type,
          convtype=convtype,
      )
      HR_conv1 = conv_block(
          nf,
          out_nc,
          kernel_size=3,
          norm_type=None,
          act_type=None,
          convtype=convtype,
      )
  
      outact = act(finalact) if finalact else None
  
      self.model = sequential(
          fea_conv,
          ShortcutBlock(sequential(*rb_blocks, LR_conv)),
          *upsampler,
          HR_conv0,
          HR_conv1,
          outact,
      )
  
imports: from collections import OrderedDict
  import math
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new RRDBNet object from inherited base classes: nn with example: obj = RRDBNet(in_nc, out_nc, nf, nb, nr, gc, upscale, norm_type, act_type, mode, upsample_mode, convtype, finalact, gaussian_noise, plus)