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 as chunks.
  
  Args:
      x: Encoder input features. (1, T_in, F)
      x_len: Encoder input features lengths. (1,)
      processed_frames: Number of frames already seen.
      left_context: Number of previous frames (AFTER subsampling) the attention
                    module can see in current chunk.
  
  Returns:
     x: Encoder outputs. (B, T_out, D_enc)
code: def chunk_forward(
      self,
      x: torch.Tensor,
      x_len: torch.Tensor,
      processed_frames: torch.tensor,
      left_context: int = 32,
  ) -> torch.Tensor:
      """Encode input sequences as chunks.
  
      Args:
          x: Encoder input features. (1, T_in, F)
          x_len: Encoder input features lengths. (1,)
          processed_frames: Number of frames already seen.
          left_context: Number of previous frames (AFTER subsampling) the attention
                        module can see in current chunk.
  
      Returns:
         x: Encoder outputs. (B, T_out, D_enc)
  
      """
      mask = make_source_mask(x_len)
      x, mask = self.embed(x, mask)
  
      x = x[:, 1:-1, :]
      mask = mask[:, 1:-1]
  
      pos_enc = self.pos_enc(x, left_context=left_context)
  
      processed_mask = (
          torch.arange(left_context, device=x.device)
          .view(1, left_context)
          .flip(1)
      )
  
      processed_mask = processed_mask >= processed_frames
  
      mask = torch.cat([processed_mask, mask], dim=1)
  
      x = self.encoders.chunk_forward(
          x,
          pos_enc,
          mask,
          left_context=left_context,
      )
  
      return x
  
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 4 for calling the Encoder obj's underlying member method code with example usage: obj.chunk_forward(x, x_len, processed_frames, left_context) and returns: x