code: def __init__(self, hparams):
      super(AudioEncoder, self).__init__()
  
      assert hparams.lat_dim > 0
  
      convolutions = []
      inp_dim = hparams.n_mel_channels
      for _ in range(hparams.lat_n_convolutions):
          conv_layer = nn.Sequential(
              ConvNorm(
                  inp_dim,
                  hparams.lat_n_filters,
                  kernel_size=hparams.lat_kernel_size,
                  stride=1,
                  padding=int((hparams.lat_kernel_size - 1) / 2),
                  dilation=1,
                  w_init_gain="tanh",
              ),
              nn.BatchNorm1d(hparams.lat_n_filters),
          )
          inp_dim = hparams.lat_n_filters
          convolutions.append(conv_layer)
      self.convolutions = nn.ModuleList(convolutions)
  
      self.lstm = nn.LSTM(
          hparams.lat_n_filters,
          int(hparams.lat_n_filters / 2),
          hparams.lat_n_blstms,
          batch_first=True,
          bidirectional=True,
      )
      self.pool = GlobalAvgPool()
  
      self.mu_proj = LinearNorm(hparams.lat_n_filters, hparams.lat_dim)
      self.logvar_proj = LinearNorm(
          hparams.lat_n_filters, hparams.lat_dim
      )
      self.lat_dim = hparams.lat_dim
  
imports: from math import sqrt
  import torch
  import torch.distributions
  from torch.autograd import Variable
  from torch import nn
  from torch.nn import functional
  from .layers import ConvNorm, LinearNorm, GlobalAvgPool
  from .utils import to_gpu, get_mask_from_lengths
label_desc: Use image node_id 1 to create a new AudioEncoder object from inherited base classes: nn with example: obj = AudioEncoder(hparams)