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
docstr: Encoder forward
  
  :param torch.Tensor xs_pad: batch of padded input sequences (B, Tmax, D)
  :param torch.Tensor ilens: batch of lengths of input sequences (B)
  :param torch.Tensor prev_state: batch of previous encoder hidden states (?, ...)
  :return: batch of hidden state sequences (B, Tmax, eprojs)
  :rtype: torch.Tensor
docstr_tok: ["Encoder","forward",":","param","torch.Tensor","xs_pad",":","batch","of","padded","input","sequences","(","B",",","Tmax",",","D",")",":","param","torch.Tensor","ilens",":","batch","of","lengths","of","input","sequences","(","B",")",":","param","torch.Tensor","prev_state",":","batch","of","previous","encoder","hidden","states","(","?",",","...",")",":","return",":","batch","of","hidden","state","sequences","(","B",",","Tmax",",","eprojs",")",":","rtype",":","torch.Tensor"]
code: def forward(self, xs_pad, ilens, prev_states=None):
      """Encoder forward
  
      :param torch.Tensor xs_pad: batch of padded input sequences (B, Tmax, D)
      :param torch.Tensor ilens: batch of lengths of input sequences (B)
      :param torch.Tensor prev_state: batch of previous encoder hidden states (?, ...)
      :return: batch of hidden state sequences (B, Tmax, eprojs)
      :rtype: torch.Tensor
      """
      if prev_states is None:
          prev_states = [None] * len(self.enc)
      assert len(prev_states) == len(self.enc)
  
      current_states = []
      for module, prev_state in zip(self.enc, prev_states):
          xs_pad, ilens, states = module(
              xs_pad, ilens, prev_state=prev_state
          )
          current_states.append(states)
  
      # make mask to remove bias value in padded part
      mask = to_device(xs_pad, make_pad_mask(ilens).unsqueeze(-1))
  
      return xs_pad.masked_fill(mask, 0.0), ilens, current_states
  
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 2 for calling the Encoder obj's underlying member method code with example usage: obj.forward(xs_pad, ilens, prev_states) and returns: xs_pad,  ilens,  current_states