code: def __init__(
      self,
      vocab: Dictionary,
      filters: List[Tuple[int, int]],
      char_embed_dim: int,
      word_embed_dim: int,
      highway_layers: int,
      max_char_len: int = 50,
      char_inputs: bool = False,
  ):
      super(CharacterTokenEmbedder, self).__init__()
  
      self.onnx_trace = False
      self.embedding_dim = word_embed_dim
      self.max_char_len = max_char_len
      self.char_embeddings = nn.Embedding(
          257, char_embed_dim, padding_idx=0
      )
      self.symbol_embeddings = nn.Parameter(
          torch.FloatTensor(2, word_embed_dim)
      )
      self.eos_idx, self.unk_idx = 0, 1
      self.char_inputs = char_inputs
  
      self.convolutions = nn.ModuleList()
      for width, out_c in filters:
          self.convolutions.append(
              nn.Conv1d(char_embed_dim, out_c, kernel_size=width)
          )
  
      last_dim = sum(f[1] for f in filters)
  
      self.highway = (
          Highway(last_dim, highway_layers)
          if highway_layers > 0
          else None
      )
  
      self.projection = nn.Linear(last_dim, word_embed_dim)
  
      assert (
          vocab is not None or char_inputs
      ), "vocab must be set if not using char inputs"
      self.vocab = None
      if vocab is not None:
          self.set_vocab(vocab, max_char_len)
  
      self.reset_parameters()
  
file_path: fairseq/fairseq/modules/character_token_embedder.py
imports: import logging
  from typing import List, Tuple
  import torch
  import torch.nn.functional
  from fairseq.data import Dictionary
  from torch import nn
label_desc: Use image node_id 1 to create a new CharacterTokenEmbedder object from inherited base classes: torch.nn with example: obj = CharacterTokenEmbedder(vocab, filters, char_embed_dim, word_embed_dim, highway_layers, max_char_len, char_inputs)