class_docstr: Residual in Residual Dense Block
  (ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks)
class_docstr_tok: ["Residual","in","Residual","Dense","Block","(","ESRGAN",":","Enhanced","Super-Resolution","Generative","Adversarial","Networks",")"]
code: def __init__(
      self,
      nf,
      nr=3,
      kernel_size=3,
      gc=32,
      stride=1,
      bias=1,
      pad_type="zero",
      norm_type=None,
      act_type="leakyrelu",
      mode="CNA",
      convtype="Conv2D",
      spectral_norm=False,
      gaussian_noise=False,
      plus=False,
  ):
      super(RRDB, self).__init__()
      # This is for backwards compatibility with existing models
      if nr == 3:
          self.RDB1 = ResidualDenseBlock_5C(
              nf,
              kernel_size,
              gc,
              stride,
              bias,
              pad_type,
              norm_type,
              act_type,
              mode,
              convtype,
              spectral_norm=spectral_norm,
              gaussian_noise=gaussian_noise,
              plus=plus,
          )
          self.RDB2 = ResidualDenseBlock_5C(
              nf,
              kernel_size,
              gc,
              stride,
              bias,
              pad_type,
              norm_type,
              act_type,
              mode,
              convtype,
              spectral_norm=spectral_norm,
              gaussian_noise=gaussian_noise,
              plus=plus,
          )
          self.RDB3 = ResidualDenseBlock_5C(
              nf,
              kernel_size,
              gc,
              stride,
              bias,
              pad_type,
              norm_type,
              act_type,
              mode,
              convtype,
              spectral_norm=spectral_norm,
              gaussian_noise=gaussian_noise,
              plus=plus,
          )
      else:
          RDB_list = [
              ResidualDenseBlock_5C(
                  nf,
                  kernel_size,
                  gc,
                  stride,
                  bias,
                  pad_type,
                  norm_type,
                  act_type,
                  mode,
                  convtype,
                  spectral_norm=spectral_norm,
                  gaussian_noise=gaussian_noise,
                  plus=plus,
              )
              for _ in range(nr)
          ]
          self.RDBs = nn.Sequential(*RDB_list)
  
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 RRDB object from inherited base classes: nn with example: obj = RRDB(nf, nr, kernel_size, gc, stride, bias, pad_type, norm_type, act_type, mode, convtype, spectral_norm, gaussian_noise, plus)