class_docstr: A ``TokenCharactersEncoder`` takes the output of a
  :class:`~allennlp.data.token_indexers.TokenCharactersIndexer`, 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.
code: def from_params(cls, vocab, params):  # type: ignore
      # pylint: disable=arguments-differ
      embedding_params = params.pop("embedding")
      # Embedding.from_params() uses "tokens" as the default namespace, but we need to change
      # that to be "token_characters" by default.
      embedding_params.setdefault("vocab_namespace", "token_characters")
      embedding = Embedding.from_params(vocab, embedding_params)
      encoder_params = params.pop("encoder")
      encoder = Seq2VecEncoder.from_params(encoder_params)
      dropout = params.pop_float("dropout", 0.0)
      params.assert_empty(cls.__name__)
      return cls(embedding, encoder, dropout)
  
file_path: magnitude/pymagnitude/third_party/allennlp/modules/token_embedders/token_characters_encoder.py
imports: from __future__ import absolute_import
  import torch
  from allennlp.common import Params
  from allennlp.data.vocabulary import Vocabulary
  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 4 for calling the TokenCharactersEncoder obj's underlying member method code with example usage: obj.from_params(cls, vocab, params) and returns: cls