class_docstr: CharLSTM aims to generate character-level embeddings for tokens.
  It summarizes the information of characters in each token to an embedding using a LSTM layer.
  
  Args:
      n_char (int):
          The number of characters.
      n_embed (int):
          The size of each embedding vector as input to LSTM.
      n_out (int):
          The size of each output vector.
      pad_index (int):
          The index of the padding token in the vocabulary. Default: 0.
class_docstr_tok: ["CharLSTM","aims","to","generate","character-level","embeddings","for","tokens",".","It","summarizes","the","information","of","characters","in","each","token","to","an","embedding","using","a","LSTM","layer",".","Args",":","n_char","(","int",")",":","The","number","of","characters",".","n_embed","(","int",")",":","The","size","of","each","embedding","vector","as","input","to","LSTM",".","n_out","(","int",")",":","The","size","of","each","output","vector",".","pad_index","(","int",")",":","The","index","of","the","padding","token","in","the","vocabulary",".","Default",":","0","."]
code: def __init__(self, n_chars, n_embed, n_out, pad_index=0):
      super().__init__()
  
      self.n_chars = n_chars
      self.n_embed = n_embed
      self.n_out = n_out
      self.pad_index = pad_index
  
      # the embedding layer
      self.embed = nn.Embedding(
          num_embeddings=n_chars, embedding_dim=n_embed
      )
      # the lstm layer
      self.lstm = nn.LSTM(
          input_size=n_embed,
          hidden_size=n_out // 2,
          batch_first=True,
          bidirectional=True,
      )
  
imports: import torch
  import torch.nn
  from torch.nn.utils.rnn import pack_padded_sequence, PackedSequence
  from torch.nn.modules.rnn import apply_permutation
label_desc: Use image node_id 1 to create a new CharLSTM object from inherited base classes: nn with example: obj = CharLSTM(n_chars, n_embed, n_out, pad_index)