class_docstr: A `TokenCharactersEncoder` takes the output of a
  [`TokenCharactersIndexer`](../../data/token_indexers/token_characters_indexer.md), which is a tensor of shape
  (batch_size, num_tokens, num_characters), embeds the characters, runs a token-level encoder, and
  returns the result, which is a tensor of shape (batch_size, num_tokens, encoding_dim).  We also
  optionally apply dropout after the token-level encoder.
  
  We take the embedding and encoding modules as input, so this class is itself quite simple.
  
  Registered as a `TokenEmbedder` with name "character_encoding".
code: def __init__(
      self,
      embedding: Embedding,
      encoder: Seq2VecEncoder,
      dropout: float = 0.0,
  ) -> None:
      super().__init__()
      self._embedding = TimeDistributed(embedding)
      self._encoder = TimeDistributed(encoder)
      if dropout > 0:
          self._dropout = torch.nn.Dropout(p=dropout)
      else:
          self._dropout = lambda x: x
  
file_path: allennlp/allennlp/modules/token_embedders/token_characters_encoder.py
imports: import torch
  from allennlp.modules.token_embedders.embedding import Embedding
  from allennlp.modules.seq2vec_encoders.seq2vec_encoder import Seq2VecEncoder
  from allennlp.modules.time_distributed import TimeDistributed
  from allennlp.modules.token_embedders.token_embedder import TokenEmbedder
label_desc: Use image node_id 1 to create a new TokenCharactersEncoder object from inherited base classes: TokenEmbedder with example: obj = TokenCharactersEncoder(embedding, encoder, dropout)