code: def __init__(self, h):
      super().__init__()
      self.h = h
      self.num_kernels = len(h.resblock_kernel_sizes)
      self.num_upsamples = len(h.upsample_rates)
      self.conv_pre = hk.Conv1D(
          h.upsample_initial_channel, 7, 1, padding=((3, 3),)
      )
      resblock = ResBlock1 if h.resblock == "1" else ResBlock2
      self.ups = []
      for i, (u, k) in enumerate(
          zip(h.upsample_rates, h.upsample_kernel_sizes)
      ):
          self.ups.append(
              hk.Conv1DTranspose(
                  h.upsample_initial_channel // (2 ** (i + 1)),
                  kernel_shape=k,
                  stride=u,
                  padding="SAME",
                  name=f"ups_{i}",
              )
          )
  
      self.resblocks = []
  
      for i in range(len(self.ups)):
          ch = h.upsample_initial_channel // (2 ** (i + 1))
          for j, (k, d) in enumerate(
              zip(h.resblock_kernel_sizes, h.resblock_dilation_sizes)
          ):
              self.resblocks.append(
                  resblock(
                      h,
                      ch,
                      k,
                      d,
                      name=f"res_block1_{len(self.resblocks)}",
                  )
              )
      self.conv_post = hk.Conv1D(1, 7, 1, padding=((3, 3),))
  
file_path: underthesea/underthesea/pipeline/say/viettts_/hifigan/model.py
imports: import haiku
  import jax
  import jax.numpy
label_desc: Use image node_id 1 to create a new Generator object from inherited base classes: hk with example: obj = Generator(h)