class_docstr: Encoder module
  
  :param str etype: type of encoder network
  :param int idim: number of dimensions of encoder network
  :param int elayers: number of layers of encoder network
  :param int eunits: number of lstm units of encoder network
  :param int eprojs: number of projection units of encoder network
  :param np.ndarray subsample: list of subsampling numbers
  :param float dropout: dropout rate
  :param int in_channel: number of input channels
code: def __init__(
      self,
      etype,
      idim,
      elayers,
      eunits,
      eprojs,
      subsample,
      dropout,
      in_channel=1,
  ):
      super(Encoder, self).__init__()
      typ = etype.lstrip("vgg").rstrip("p")
      if typ not in ["lstm", "gru", "blstm", "bgru"]:
          logging.error(
              "Error: need to specify an appropriate encoder architecture"
          )
  
      if etype.startswith("vgg"):
          if etype[-1] == "p":
              self.enc = torch.nn.ModuleList(
                  [
                      VGG2L(in_channel),
                      RNNP(
                          get_vgg2l_odim(idim, in_channel=in_channel),
                          elayers,
                          eunits,
                          eprojs,
                          subsample,
                          dropout,
                          typ=typ,
                      ),
                  ]
              )
              logging.info(
                  "Use CNN-VGG + " + typ.upper() + "P for encoder"
              )
          else:
              self.enc = torch.nn.ModuleList(
                  [
                      VGG2L(in_channel),
                      RNN(
                          get_vgg2l_odim(idim, in_channel=in_channel),
                          elayers,
                          eunits,
                          eprojs,
                          dropout,
                          typ=typ,
                      ),
                  ]
              )
              logging.info(
                  "Use CNN-VGG + " + typ.upper() + " for encoder"
              )
          self.conv_subsampling_factor = 4
      else:
          if etype[-1] == "p":
              self.enc = torch.nn.ModuleList(
                  [
                      RNNP(
                          idim,
                          elayers,
                          eunits,
                          eprojs,
                          subsample,
                          dropout,
                          typ=typ,
                      )
                  ]
              )
              logging.info(
                  typ.upper()
                  + " with every-layer projection for encoder"
              )
          else:
              self.enc = torch.nn.ModuleList(
                  [RNN(idim, elayers, eunits, eprojs, dropout, typ=typ)]
              )
              logging.info(
                  typ.upper() + " without projection for encoder"
              )
          self.conv_subsampling_factor = 1
  
imports: import logging
  import numpy
  import torch
  import torch.nn.functional
  from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
  from espnet.nets.e2e_asr_common import get_vgg2l_odim
  from espnet.nets.pytorch_backend.nets_utils import make_pad_mask, to_device
label_desc: Use image node_id 1 to create a new Encoder object from inherited base classes: torch.nn with example: obj = Encoder(etype, idim, elayers, eunits, eprojs, subsample, dropout, in_channel)