class_docstr: DiffWave Model with dilated residual blocks
  
  Arguments
  ---------
  input_channels:
      input mel channels of conv1x1 for conditional vocoding task
  residual_layers:
      number of residual blocks
  residual_channels:
      channels of audio convolution
  dilation_cycle_length:
      dilation cycles of audio convolution
  total_steps:
      total steps of diffusion
  unconditional:
      conditional/unconditional generation
  
  Example
  -------
  >>> from speechbrain.lobes.models.DiffWave import DiffWave
  >>> diffwave = DiffWave(
  ...     input_channels=80,
  ...     residual_layers=30,
  ...     residual_channels=64,
  ...     dilation_cycle_length=10,
  ...     total_steps=50,
  ... )
  >>> noisy_audio = torch.randn(1, 1, 25600)
  >>> timestep = torch.randint(50, (1,))
  >>> input_mel = torch.rand(1, 80, 100)
  >>> predicted_noise = diffwave(noisy_audio, timestep, input_mel)
  >>> predicted_noise.shape
  torch.Size([1, 1, 25600])
class_docstr_tok: ["DiffWave","Model","with","dilated","residual","blocks","Arguments","--","--","--","--","-","input_channels",":","input","mel","channels","of","conv1x1","for","conditional","vocoding","task","residual_layers",":","number","of","residual","blocks","residual_channels",":","channels","of","audio","convolution","dilation_cycle_length",":","dilation","cycles","of","audio","convolution","total_steps",":","total","steps","of","diffusion","unconditional",":","conditional\/unconditional","generation","Example","--","--","--","-",">",">",">","from","speechbrain.lobes.models.DiffWave","import","DiffWave",">",">",">","diffwave","=","DiffWave","(","...","input_channels=80",",","...","residual_layers=30",",","...","residual_channels=64",",","...","dilation_cycle_length=10",",","...","total_steps=50",",","...",")",">",">",">","noisy_audio","=","torch.randn","(","1",",","1",",","25600",")",">",">",">","timestep","=","torch.randint","(","50",",","(","1",",",")",")",">",">",">","input_mel","=","torch.rand","(","1",",","80",",","100",")",">",">",">","predicted_noise","=","diffwave","(","noisy_audio",",","timestep",",","input_mel",")",">",">",">","predicted_noise.shape","torch.Size","(","[","1",",","1",",","25600","]",")"]
docstr: DiffWave forward function
  
  Arguments
  ---------
  audio: torch.Tensor
      input gaussian sample [bs, 1, time]
  diffusion_steps: torch.Tensor
      which timestep of diffusion to execute [bs, 1]
  spectrogram: torch.Tensor
      spectrogram data [bs, 80, mel_len]
  length: torch.Tensor
      sample lengths - not used - provided for compatibility only
  Returns
  -------
  predicted noise [bs, 1, time]
docstr_tok: ["DiffWave","forward","function","Arguments","--","--","--","--","-","audio",":","torch.Tensor","input","gaussian","sample","[","bs",",","1",",","time","]","diffusion_steps",":","torch.Tensor","which","timestep","of","diffusion","to","execute","[","bs",",","1","]","spectrogram",":","torch.Tensor","spectrogram","data","[","bs",",","80",",","mel_len","]","length",":","torch.Tensor","sample","lengths","-","not","used","-","provided","for","compatibility","only","Returns","--","--","--","-","predicted","noise","[","bs",",","1",",","time","]"]
code: def forward(
      self, audio, diffusion_step, spectrogram=None, length=None
  ):
      """
      DiffWave forward function
  
      Arguments
      ---------
      audio: torch.Tensor
          input gaussian sample [bs, 1, time]
      diffusion_steps: torch.Tensor
          which timestep of diffusion to execute [bs, 1]
      spectrogram: torch.Tensor
          spectrogram data [bs, 80, mel_len]
      length: torch.Tensor
          sample lengths - not used - provided for compatibility only
      Returns
      -------
      predicted noise [bs, 1, time]
      """
      assert (
          spectrogram is None and self.spectrogram_upsampler is None
      ) or (
          spectrogram is not None
          and self.spectrogram_upsampler is not None
      )
  
      x = self.input_projection(audio)
      x = F.relu(x)
  
      diffusion_step = self.diffusion_embedding(diffusion_step)
      if self.spectrogram_upsampler:  # use conditional model
          spectrogram = self.spectrogram_upsampler(spectrogram)
  
      skip = None
      for layer in self.residual_layers:
          x, skip_connection = layer(x, diffusion_step, spectrogram)
          skip = (
              skip_connection
              if skip is None
              else skip_connection + skip
          )
  
      x = skip / sqrt(len(self.residual_layers))
      x = self.skip_projection(x)
      x = F.relu(x)
      x = self.output_projection(x)
      return x
  
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 2 for calling the DiffWave obj's underlying member method code with example usage: obj.forward(audio, diffusion_step, spectrogram, length) and returns: x