class_docstr: A classical (non-variational) autoencoder that
  does not use reparameterization but instead uses
  an ordinary normalization technique to constrain
  the latent space
  
  Arguments
  ---------
  encoder: torch.nn.Module
      the encoder to be used
  decoder: torch.nn.Module
      the decoder to be used
  norm: torch.nn.Module
      the normalization module
  mask_latent: bool
      where to apply the length mask to the latent representation
  mask_out: bool
      whether to apply the length mask to the output
  out_mask_value: float
      the mask value used for the output
  
  Examples
  --------
  >>> import torch
  >>> from torch import nn
  >>> from speechbrain.nnet.linear import Linear
  >>> ae_enc = Linear(n_neurons=16, input_size=128)
  >>> ae_dec = Linear(n_neurons=128, input_size=16)
  >>> ae = NormalizingAutoencoder(
  ...     encoder=ae_enc,
  ...     decoder=ae_dec,
  ... )
  >>> x = torch.randn(4, 10, 128)
  >>> x_enc = ae.encode(x)
  >>> x_enc.shape
  torch.Size([4, 10, 16])
  >>> x_dec = ae.decode(x_enc)
  >>> x_dec.shape
  torch.Size([4, 10, 128])
docstr: Converts a sample from an original space (e.g. pixel or waveform) to a latent
  space
  
  Arguments
  ---------
  x: torch.Tensor
      the original data representation
  
  Returns
  -------
  latent: torch.Tensor
      the latent representation
docstr_tok: ["Converts","a","sample","from","an","original","space","(","e.g",".","pixel","or","waveform",")","to","a","latent","space","Arguments","--","--","--","--","-","x",":","torch.Tensor","the","original","data","representation","Returns","--","--","--","-","latent",":","torch.Tensor","the","latent","representation"]
code: def encode(self, x, length=None):
      """Converts a sample from an original space (e.g. pixel or waveform) to a latent
      space
  
      Arguments
      ---------
      x: torch.Tensor
          the original data representation
  
      Returns
      -------
      latent: torch.Tensor
          the latent representation
      """
      x = self.encoder(x)
      x = self.norm(x, lengths=length)
      return x
  
imports: import torch
  from torch import nn
  from collections import namedtuple
  from speechbrain.dataio.dataio import clean_padding
  from speechbrain.utils.data_utils import trim_as
  from speechbrain.processing.features import GlobalNorm
label_desc: Use image node_id 2 for calling the NormalizingAutoencoder obj's underlying member method code with example usage: obj.encode(x, length) and returns: x