class_docstr: Transformer encoder module.
  
  :param int idim: input dim
  :param int attention_dim: dimension of attention
  :param int attention_heads: the number of heads of multi head attention
  :param int linear_units: the number of units of position-wise feed forward
  :param int num_blocks: the number of decoder blocks
  :param float dropout_rate: dropout rate
  :param float attention_dropout_rate: dropout rate in attention
  :param float positional_dropout_rate: dropout rate after adding positional encoding
  :param str or torch.nn.Module input_layer: input layer type
  :param class pos_enc_class: PositionalEncoding or ScaledPositionalEncoding
  :param bool normalize_before: whether to use layer_norm before the first block
  :param bool concat_after: whether to concat attention layer's input and output
      if True, additional linear will be applied.
      i.e. x -> x + linear(concat(x, att(x)))
      if False, no additional linear will be applied. i.e. x -> x + att(x)
  :param str positionwise_layer_type: linear of conv1d
  :param int positionwise_conv_kernel_size: kernel size of positionwise conv1d layer
  :param int padding_idx: padding_idx for input_layer=embed
class_docstr_tok: ["Transformer","encoder","module",".",":","param","int","idim",":","input","dim",":","param","int","attention_dim",":","dimension","of","attention",":","param","int","attention_heads",":","the","number","of","heads","of","multi","head","attention",":","param","int","linear_units",":","the","number","of","units","of","position-wise","feed","forward",":","param","int","num_blocks",":","the","number","of","decoder","blocks",":","param","float","dropout_rate",":","dropout","rate",":","param","float","attention_dropout_rate",":","dropout","rate","in","attention",":","param","float","positional_dropout_rate",":","dropout","rate","after","adding","positional","encoding",":","param","str","or","torch.nn.Module","input_layer",":","input","layer","type",":","param","class","pos_enc_class",":","PositionalEncoding","or","ScaledPositionalEncoding",":","param","bool","normalize_before",":","whether","to","use","layer_norm","before","the","first","block",":","param","bool","concat_after",":","whether","to","concat","attention","layer","'s","input","and","output","if","True",",","additional","linear","will","be","applied",".","i.e",".","x","-",">","x","+","linear","(","concat","(","x",",","att","(","x",")",")",")","if","False",",","no","additional","linear","will","be","applied",".","i.e",".","x","-",">","x","+","att","(","x",")",":","param","str","positionwise_layer_type",":","linear","of","conv1d",":","param","int","positionwise_conv_kernel_size",":","kernel","size","of","positionwise","conv1d","layer",":","param","int","padding_idx",":","padding_idx","for","input_layer=embed"]
docstr: Encode input frame.
  
  :param torch.Tensor xs: input tensor
  :param torch.Tensor masks: input mask
  :param List[torch.Tensor] cache: cache tensors
  :return: position embedded tensor, mask and new cache
  :rtype Tuple[torch.Tensor, torch.Tensor, List[torch.Tensor]]:
docstr_tok: ["Encode","input","frame",".",":","param","torch.Tensor","xs",":","input","tensor",":","param","torch.Tensor","masks",":","input","mask",":","param","List","[","torch.Tensor","]","cache",":","cache","tensors",":","return",":","position","embedded","tensor",",","mask","and","new","cache",":","rtype","Tuple","[","torch.Tensor",",","torch.Tensor",",","List","[","torch.Tensor","]","]",":"]
code: def forward_one_step(self, xs, masks, cache=None):
      """Encode input frame.
  
      :param torch.Tensor xs: input tensor
      :param torch.Tensor masks: input mask
      :param List[torch.Tensor] cache: cache tensors
      :return: position embedded tensor, mask and new cache
      :rtype Tuple[torch.Tensor, torch.Tensor, List[torch.Tensor]]:
      """
      if isinstance(self.embed, Conv2dSubsampling):
          xs, masks = self.embed(xs, masks)
      else:
          xs = self.embed(xs)
  
      new_cache_sd = []
      for ns in range(self.num_spkrs):
          if cache is None:
              cache = [
                  None
                  for _ in range(
                      len(self.encoders_sd) + len(self.encoders_rec)
                  )
              ]
          new_cache = []
          for c, e in zip(
              cache[: len(self.encoders_sd)], self.encoders_sd[ns]
          ):
              xs, masks = e(xs, masks, cache=c)
              new_cache.append(xs)
          for c, e in zip(
              cache[: len(self.encoders_sd) :], self.encoders_rec
          ):
              xs, masks = e(xs, masks, cache=c)
              new_cache.append(xs)
          new_cache_sd.append(new_cache)
          if self.normalize_before:
              xs = self.after_norm(xs)
      return xs, masks, new_cache_sd
  
file_path: espnet/espnet/nets/pytorch_backend/transformer/encoder_mix.py
imports: import torch
  from espnet.nets.pytorch_backend.transducer.vgg2l import VGG2L
  from espnet.nets.pytorch_backend.transformer.attention import MultiHeadedAttention
  from espnet.nets.pytorch_backend.transformer.embedding import PositionalEncoding
  from espnet.nets.pytorch_backend.transformer.encoder import Encoder
  from espnet.nets.pytorch_backend.transformer.encoder_layer import EncoderLayer
  from espnet.nets.pytorch_backend.transformer.repeat import repeat
  from espnet.nets.pytorch_backend.transformer.subsampling import Conv2dSubsampling
label_desc: Use image node_id 3 for calling the EncoderMix obj's underlying member method code with example usage: obj.forward_one_step(xs, masks, cache) and returns: xs,  masks,  new_cache_sd