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: Construct an Encoder object.
code: def __init__(
      self,
      input_size: int,
      body_conf: List[Dict[str, Any]],
      input_conf: Dict[str, Any] = {},
      main_conf: Dict[str, Any] = {},
  ) -> None:
      """Construct an Encoder object."""
      super().__init__()
  
      assert check_argument_types()
  
      embed_size, output_size = validate_architecture(
          input_conf, body_conf, input_size
      )
      main_params = build_main_parameters(**main_conf)
  
      self.embed = build_input_block(input_size, input_conf)
      self.pos_enc = build_positional_encoding(embed_size, main_params)
      self.encoders = build_body_blocks(
          body_conf, main_params, output_size
      )
  
      self.output_size = output_size
  
      self.dynamic_chunk_training = main_params[
          "dynamic_chunk_training"
      ]
      self.short_chunk_threshold = main_params["short_chunk_threshold"]
      self.short_chunk_size = main_params["short_chunk_size"]
      self.num_left_chunks = main_params["num_left_chunks"]
  
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 1 to create a new Encoder object from inherited base classes: torch.nn with example: obj = Encoder(input_size, body_conf, input_conf, main_conf)