class_docstr: A standard interface for autoencoders
  
  Example
  -------
  >>> import torch
  >>> from torch import nn
  >>> from speechbrain.nnet.linear import Linear
  >>> class SimpleAutoencoder(Autoencoder):
  ...    def __init__(self):
  ...        super().__init__()
  ...        self.enc = Linear(n_neurons=16, input_size=128)
  ...        self.dec = Linear(n_neurons=128, input_size=16)
  ...    def encode(self, x, length=None):
  ...        return self.enc(x)
  ...    def decode(self, x, length=None):
  ...        return self.dec(x)
  >>> autoencoder = SimpleAutoencoder()
  >>> x = torch.randn(4, 10, 128)
  >>> x_enc = autoencoder.encode(x)
  >>> x_enc.shape
  torch.Size([4, 10, 16])
  >>> x_enc_fw = autoencoder(x)
  >>> x_enc_fw.shape
  torch.Size([4, 10, 16])
  >>> x_rec = autoencoder.decode(x_enc)
  >>> x_rec.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
  
  length: torch.Tensor
      a tensor of relative lengths
  
  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","length",":","torch.Tensor","a","tensor","of","relative","lengths","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
  
      length: torch.Tensor
          a tensor of relative lengths
  
      Returns
      -------
      latent: torch.Tensor
          the latent representation
      """
      raise NotImplementedError
  
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 1 for calling the Autoencoder obj's underlying member method code with example usage: obj.encode(x, length) without return types