class_docstr: RNN encoder encoding each word via a bidirectional LSTM over character
  embeddings to obtain word representations, and then an LSTM (optionally
  bidirectional in first layer) to combine word representations.
  
  Uses nn.LSTM for cuDNN support / ONNX exportability.
code: def __init__(
      self,
      dictionary,
      num_chars,
      char_embed_dim,
      token_embed_dim,
      normalize_embed,
      char_rnn_units,
      char_rnn_layers,
      hidden_dim,
      num_layers,
      dropout_in,
      dropout_out,
      residual_level,
      bidirectional,
  ):
      super().__init__(dictionary)
      self.dropout_in = dropout_in
  
      self.embed_chars = char_encoder.CharRNNModel(
          dictionary=dictionary,
          num_chars=num_chars,
          char_embed_dim=char_embed_dim,
          char_rnn_units=char_rnn_units,
          char_rnn_layers=char_rnn_layers,
      )
  
      self.embed_tokens = None
      if token_embed_dim > 0:
          self.embed_tokens = rnn.Embedding(
              num_embeddings=len(dictionary),
              embedding_dim=token_embed_dim,
              padding_idx=dictionary.pad(),
              freeze_embed=False,
              normalize_embed=normalize_embed,
          )
  
      self.word_dim = char_rnn_units + token_embed_dim
  
      self.bilstm = rnn.BiLSTM(
          num_layers=num_layers,
          bidirectional=bidirectional,
          embed_dim=self.word_dim,
          hidden_dim=hidden_dim,
          dropout=dropout_out,
          residual_level=residual_level,
      )
  
      # disables sorting and word-length thresholding if True
      # (enables ONNX tracing of length-sorted input with batch_size = 1)
      self.onnx_export_model = False
  
imports: import logging
  from ast import literal_eval
  import torch
  import torch.nn.functional
  from fairseq.models import FairseqEncoder, register_model, register_model_architecture
  from pytorch_translate import char_encoder, model_constants, rnn, utils, vocab_constants
  from pytorch_translate.common_layers import Embedding, VariableTracker
  from pytorch_translate.data.dictionary import TAGS
label_desc: Use image node_id 1 to create a new CharRNNEncoder object from inherited base classes: FairseqEncoder with example: obj = CharRNNEncoder(dictionary, num_chars, char_embed_dim, token_embed_dim, normalize_embed, char_rnn_units, char_rnn_layers, hidden_dim, num_layers, dropout_in, dropout_out, residual_level, bidirectional)