code: def __init__(
      self,
      in_channels=80,
      out_channels=1,
      use_weight_norm=False,
      y_conv_channels=32,
      x_conv_channels=768,
      dblock_out_channels=[128, 128, 256, 512],
      ublock_out_channels=[512, 512, 256, 128, 128],
      upsample_factors=[5, 5, 3, 2, 2],
      upsample_dilations=[
          [1, 2, 1, 2],
          [1, 2, 1, 2],
          [1, 2, 4, 8],
          [1, 2, 4, 8],
          [1, 2, 4, 8],
      ],
  ):
      super().__init__()
  
      self.use_weight_norm = use_weight_norm
      self.hop_len = np.prod(upsample_factors)
      self.noise_level = None
      self.num_steps = None
      self.beta = None
      self.alpha = None
      self.alpha_hat = None
      self.noise_level = None
      self.c1 = None
      self.c2 = None
      self.sigma = None
  
      # dblocks
      self.y_conv = Conv1d(1, y_conv_channels, 5, padding=2)
      self.dblocks = nn.ModuleList([])
      ic = y_conv_channels
      for oc, df in zip(
          dblock_out_channels, reversed(upsample_factors)
      ):
          self.dblocks.append(DBlock(ic, oc, df))
          ic = oc
  
      # film
      self.film = nn.ModuleList([])
      ic = y_conv_channels
      for oc in reversed(ublock_out_channels):
          self.film.append(FiLM(ic, oc))
          ic = oc
  
      # ublocks
      self.ublocks = nn.ModuleList([])
      ic = x_conv_channels
      for oc, uf, ud in zip(
          ublock_out_channels, upsample_factors, upsample_dilations
      ):
          self.ublocks.append(UBlock(ic, oc, uf, ud))
          ic = oc
  
      self.x_conv = Conv1d(in_channels, x_conv_channels, 3, padding=1)
      self.out_conv = Conv1d(oc, out_channels, 3, padding=1)
  
      if use_weight_norm:
          self.apply_weight_norm()
  
file_path: TTS/TTS/vocoder/models/wavegrad.py
imports: import numpy
  import torch
  from torch import nn
  from torch.nn.utils import weight_norm
  from ..layers.wavegrad import DBlock, FiLM, UBlock, Conv1d
label_desc: Use image node_id 1 to create a new Wavegrad object from inherited base classes: nn with example: obj = Wavegrad(in_channels, out_channels, use_weight_norm, y_conv_channels, x_conv_channels, dblock_out_channels, ublock_out_channels, upsample_factors, upsample_dilations)