class_docstr: Embedding Frontend for text based inputs.
docstr: Initialize.
  
  Args:
      input_size: Number of input tokens.
      embed_dim: Embedding Size.
      pos_enc_class: PositionalEncoding or ScaledPositionalEncoding
      positional_dropout_rate: dropout rate after adding positional encoding
docstr_tok: ["Initialize",".","Args",":","input_size",":","Number","of","input","tokens",".","embed_dim",":","Embedding","Size",".","pos_enc_class",":","PositionalEncoding","or","ScaledPositionalEncoding","positional_dropout_rate",":","dropout","rate","after","adding","positional","encoding"]
code: def __init__(
      self,
      input_size: int = 400,
      embed_dim: int = 400,
      pos_enc_class=PositionalEncoding,
      positional_dropout_rate: float = 0.1,
  ):
      """Initialize.
  
      Args:
          input_size: Number of input tokens.
          embed_dim: Embedding Size.
          pos_enc_class: PositionalEncoding or ScaledPositionalEncoding
          positional_dropout_rate: dropout rate after adding positional encoding
      """
      assert check_argument_types()
      super().__init__()
      self.embed_dim = embed_dim
      # TODO(sdalmia): check for padding idx
      self.embed = torch.nn.Sequential(
          torch.nn.Embedding(input_size, embed_dim),
          pos_enc_class(embed_dim, positional_dropout_rate),
      )
  
file_path: espnet/espnet2/mt/frontend/embedding.py
imports: from typing import Tuple
  import torch
  from typeguard import check_argument_types
  from espnet2.asr.frontend.abs_frontend import AbsFrontend
  from espnet.nets.pytorch_backend.transformer.embedding import PositionalEncoding
label_desc: Use image node_id 1 to create a new Embedding object from inherited base classes: AbsFrontend with example: obj = Embedding(input_size, embed_dim, pos_enc_class, positional_dropout_rate)