class_docstr: Encoder module definition.
  
  Args:
      input_size: Input size.
      body_conf: Encoder body configuration.
      input_conf: Encoder input configuration.
      main_conf: Encoder main configuration.
docstr: Encode input sequences.
  
  Args:
      x: Encoder input features. (B, T_in, F)
      x_len: Encoder input features lengths. (B,)
  
  Returns:
     x: Encoder outputs. (B, T_out, D_enc)
     x_len: Encoder outputs lenghts. (B,)
code: def forward(
      self,
      x: torch.Tensor,
      x_len: torch.Tensor,
  ) -> Tuple[torch.Tensor, torch.Tensor]:
      """Encode input sequences.
  
      Args:
          x: Encoder input features. (B, T_in, F)
          x_len: Encoder input features lengths. (B,)
  
      Returns:
         x: Encoder outputs. (B, T_out, D_enc)
         x_len: Encoder outputs lenghts. (B,)
  
      """
      short_status, limit_size = check_short_utt(
          self.embed.subsampling_factor, x.size(1)
      )
  
      if short_status:
          raise TooShortUttError(
              f"has {x.size(1)} frames and is too short for subsampling "
              + f"(it needs more than {limit_size} frames), return empty results",
              x.size(1),
              limit_size,
          )
  
      mask = make_source_mask(x_len)
  
      x, mask = self.embed(x, mask)
      pos_enc = self.pos_enc(x)
  
      if self.dynamic_chunk_training:
          max_len = x.size(1)
          chunk_size = torch.randint(1, max_len, (1,)).item()
  
          if chunk_size > (max_len * self.short_chunk_threshold):
              chunk_size = max_len
          else:
              chunk_size = (chunk_size % self.short_chunk_size) + 1
  
          chunk_mask = make_chunk_mask(
              x.size(1),
              chunk_size,
              num_left_chunks=self.num_left_chunks,
              device=x.device,
          )
      else:
          chunk_mask = None
  
      x = self.encoders(
          x,
          pos_enc,
          mask,
          chunk_mask=chunk_mask,
      )
  
      return x, mask.eq(0).sum(1)
  
file_path: espnet/espnet2/asr_transducer/encoder/encoder.py
imports: from typing import Any, Dict, List, Tuple
  import torch
  from typeguard import check_argument_types
  from espnet2.asr_transducer.encoder.building import build_body_blocks, build_input_block, build_main_parameters, build_positional_encoding
  from espnet2.asr_transducer.encoder.validation import validate_architecture
  from espnet2.asr_transducer.utils import TooShortUttError, check_short_utt, make_chunk_mask, make_source_mask
label_desc: Use image node_id 3 for calling the Encoder obj's underlying member method code with example usage: obj.forward(x, x_len) and returns: x,  mask