class_docstr: CNN Autoencoder model to clean speech signals.
  
  Arguments
  ---------
  kernel_size : int
      Size of the convolutional kernel.
  latent_vae : bool
      Whether or not to convert the autoencoder to a vae
  z_prob : bool
      Whether to remove the latent variable concatenation. Is only applicable if latent_vae is False
docstr: Forward pass through autoencoder
docstr_tok: ["Forward","pass","through","autoencoder"]
code: def forward(self, x):
      """Forward pass through autoencoder"""
      # encode
      skips = []
      x = x.permute(0, 2, 1)
      for i, layer in enumerate(self.EncodeLayers):
          x = layer(x)
          skips.append(x.clone())
          if i == len(self.DecodeLayers) - 1:
              continue
          else:
              x = F.leaky_relu(x, negative_slope=0.3)
  
      # fuse z
      if self.latent_vae:
          z_mean, z_logvar = x.chunk(2, dim=1)
          x = z_mean + torch.exp(z_logvar / 2.0) * torch.randn_like(
              z_logvar, device=x.device
          )  # sampling from latent var probability distribution
      elif self.z_prob:
          z = torch.normal(torch.zeros_like(x), torch.ones_like(x))
          x = torch.cat((x, z), 1)
      else:
          z = torch.zeros_like(x)
          x = torch.cat((x, z), 1)
  
      # decode
      for i, layer in enumerate(self.DecodeLayers):
          x = layer(x)
          if i == len(self.DecodeLayers) - 1:
              continue
          else:
              x = torch.cat((x, skips[-1 * (i + 2)]), 1)
              x = F.leaky_relu(x, negative_slope=0.3)
      x = x.permute(0, 2, 1)
      if self.latent_vae:
          return x, z_mean, z_logvar
      else:
          return x
  
file_path: speechbrain/speechbrain/lobes/models/segan_model.py
imports: import torch
  import torch.nn
  import torch.utils.data
  import torch.nn.functional
  from math import floor
label_desc: Use image node_id 2 for calling the Generator obj's underlying member method code with example usage: obj.forward(x) and returns: x,  z_mean,  z_logvar, x