class_docstr: A wrapper that adds positional information,
  masks the input and then runs the latent encoder.
  Arguments
  ---------
  in_dim : int
      Last dimension of input tensor.
  embedding_dim : int
      Dimension to project input to and that the latent encoder will use.
  latent_encoder : torch.nn.module
      Initialized latent encoder object.
  positional_encoding : torch.nn.module
      Uninitialized nn.module for adding positional information, will use ``embedding_dim``.
  dropout_encoder_input : float
      Dropout on encoder input.
  
  Example
  -------
  >>> from speechbrain.lobes.models.transformer.Transformer import TransformerEncoder
  >>> encoder = TransformerEncoder(d_model=768, num_layers=4, nhead=4, d_ffn=1024)
  >>> wrapper = EncoderWrapper(1024, 768, encoder)
  >>> inputs = torch.rand(10, 12, 1024)
  >>> outputs = wrapper(inputs)
  >>> outputs["embeddings"].shape
  torch.Size([10, 12, 768])
code: def __init__(
      self,
      in_dim,
      embedding_dim,
      latent_encoder,
      positional_encoding=PositionalEncoding,
      dropout_encoder_input=0.05,
  ):
      super().__init__()
      self.input_projector = nn.Linear(in_dim, embedding_dim)
      self.latent_encoder = latent_encoder
      self.positional_encoding = positional_encoding(embedding_dim)
      self.dropout_encoder_input = nn.Dropout(dropout_encoder_input)
      self.mask_emb = nn.Parameter(
          torch.FloatTensor(embedding_dim).uniform_(),
          requires_grad=True,
      )
  
imports: import logging
  import torch
  import torch.nn.functional
  import torch.nn
  import random
  import numpy
  from speechbrain.lobes.models.transformer.Transformer import PositionalEncoding
  from speechbrain.utils.data_utils import batch_pad_right
  from speechbrain.dataio.dataio import length_to_mask
  from speechbrain.lobes.models.convolution import ConvolutionFrontEnd
  from speechbrain.nnet.CNN import Conv1d
  from speechbrain.nnet.normalization import LayerNorm
  from speechbrain.nnet.quantisers import GumbelVectorQuantizer
label_desc: Use image node_id 1 to create a new EncoderWrapper object from inherited base classes: nn with example: obj = EncoderWrapper(in_dim, embedding_dim, latent_encoder, positional_encoding, dropout_encoder_input)