class_docstr: A decoder that is similar to the HybridRNNDecoder but has a character
  CNN encoder to get the representation for each generated previous token.
  The decoder is similar to https://arxiv.org/pdf/1809.02223.pdf.
class_docstr_tok: ["A","decoder","that","is","similar","to","the","HybridRNNDecoder","but","has","a","character","CNN","encoder","to","get","the","representation","for","each","generated","previous","token",".","The","decoder","is","similar","to","https",":","\/\/arxiv.org\/pdf\/1809.02223.pdf","."]
code: def __init__(
      self,
      args,
      src_dict,
      dst_dict,
      embed_tokens,
      num_chars=50,
      char_embed_dim=32,
      char_cnn_params="[(128, 3), (128, 5)]",
      char_cnn_nonlinear_fn="tanh",
      char_cnn_num_highway_layers=0,
      use_pretrained_weights=False,
      finetune_pretrained_weights=False,
  ):
      super().__init__(args, src_dict, dst_dict, embed_tokens)
      convolutions_params = literal_eval(char_cnn_params)
      self.char_cnn_encoder = char_encoder.CharCNNModel(
          dictionary=dst_dict,
          num_chars=num_chars,
          char_embed_dim=char_embed_dim,
          convolutions_params=convolutions_params,
          nonlinear_fn_type=char_cnn_nonlinear_fn,
          num_highway_layers=char_cnn_num_highway_layers,
          # char_cnn_output_dim should match the word embedding dimension.
          char_cnn_output_dim=embed_tokens.embedding_dim,
          use_pretrained_weights=use_pretrained_weights,
          finetune_pretrained_weights=finetune_pretrained_weights,
      )
      self.char_layer_norm = nn.LayerNorm(embed_tokens.embedding_dim)
  
      # By default (before training ends), character representations are
      # not precomputed. After precomputation, this value should be used in place of
      # the two embeddings.
      self._is_precomputed = False
      self.combined_word_char_embed = nn.Embedding(
          embed_tokens.num_embeddings, embed_tokens.embedding_dim
      )
  
imports: import math
  from ast import literal_eval
  from typing import List
  import torch
  import torch.nn
  import torch.nn.functional
  from fairseq.models import register_model, register_model_architecture
  from pytorch_translate import char_encoder, char_source_hybrid, char_source_model, hybrid_transformer_rnn, transformer, vocab_constants
  from pytorch_translate.data.dictionary import TAGS
  from pytorch_translate.utils import maybe_cuda
label_desc: Use image node_id 1 to create a new CharAwareHybridRNNDecoder object from inherited base classes: hybrid_transformer_rnn with example: obj = CharAwareHybridRNNDecoder(args, src_dict, dst_dict, embed_tokens, num_chars, char_embed_dim, char_cnn_params, char_cnn_nonlinear_fn, char_cnn_num_highway_layers, use_pretrained_weights, finetune_pretrained_weights)