class_docstr: Residual Block with dilated convolution
  
  Arguments
  ---------
  n_mels:
      input mel channels of conv1x1 for conditional vocoding task
  residual_channels:
      channels of audio convolution
  dilation:
      dilation cycles of audio convolution
  uncond:
      conditional/unconditional generation
  
  Example
  -------
  >>> from speechbrain.lobes.models.DiffWave import ResidualBlock
  >>> res_block = ResidualBlock(n_mels=80, residual_channels=64, dilation=3)
  >>> noisy_audio = torch.randn(1, 1, 22050)
  >>> timestep_embedding = torch.rand(1, 512)
  >>> upsampled_mel = torch.rand(1, 80, 22050)
  >>> output = res_block(noisy_audio, timestep_embedding, upsampled_mel)
  >>> output[0].shape
  torch.Size([1, 64, 22050])
class_docstr_tok: ["Residual","Block","with","dilated","convolution","Arguments","--","--","--","--","-","n_mels",":","input","mel","channels","of","conv1x1","for","conditional","vocoding","task","residual_channels",":","channels","of","audio","convolution","dilation",":","dilation","cycles","of","audio","convolution","uncond",":","conditional\/unconditional","generation","Example","--","--","--","-",">",">",">","from","speechbrain.lobes.models.DiffWave","import","ResidualBlock",">",">",">","res_block","=","ResidualBlock","(","n_mels=80",",","residual_channels=64",",","dilation=3",")",">",">",">","noisy_audio","=","torch.randn","(","1",",","1",",","22050",")",">",">",">","timestep_embedding","=","torch.rand","(","1",",","512",")",">",">",">","upsampled_mel","=","torch.rand","(","1",",","80",",","22050",")",">",">",">","output","=","res_block","(","noisy_audio",",","timestep_embedding",",","upsampled_mel",")",">",">",">","output","[","0","]",".shape","torch.Size","(","[","1",",","64",",","22050","]",")"]
code: def __init__(self, n_mels, residual_channels, dilation, uncond=False):
      super().__init__()
      self.dilated_conv = Conv1d(
          in_channels=residual_channels,
          out_channels=2 * residual_channels,
          kernel_size=3,
          dilation=dilation,
          skip_transpose=True,
          padding="same",
          conv_init="kaiming",
      )
      self.diffusion_projection = Linear(
          input_size=512, n_neurons=residual_channels
      )
  
      # conditional model
      if not uncond:
          self.conditioner_projection = Conv1d(
              in_channels=n_mels,
              out_channels=2 * residual_channels,
              kernel_size=1,
              skip_transpose=True,
              padding="same",
              conv_init="kaiming",
          )
      # unconditional model
      else:
          self.conditioner_projection = None
  
      self.output_projection = Conv1d(
          in_channels=residual_channels,
          out_channels=2 * residual_channels,
          kernel_size=1,
          skip_transpose=True,
          padding="same",
          conv_init="kaiming",
      )
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from speechbrain.nnet.CNN import Conv1d
  from speechbrain.nnet import linear
  from speechbrain.nnet.diffusion import DenoisingDiffusion
  from math import sqrt
  from torchaudio import transforms
label_desc: Use image node_id 1 to create a new ResidualBlock object from inherited base classes: nn with example: obj = ResidualBlock(n_mels, residual_channels, dilation, uncond)