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 _get_char_cnn_output(self, char_inds):
      if char_inds.dim() == 2:
          char_inds = char_inds.unsqueeze(1)
      bsz, seqlen, maxchars = char_inds.size()
  
      # char_cnn_encoder takes input (max_word_length, total_words)
      char_inds_flat = char_inds.view(-1, maxchars).t()
      # output (total_words, encoder_dim)
      char_cnn_output = self.char_cnn_encoder(char_inds_flat)
  
      char_cnn_output = char_cnn_output.view(
          bsz, seqlen, char_cnn_output.shape[-1]
      )
      # (seqlen, bsz, char_cnn_output_dim)
      char_cnn_output = char_cnn_output.transpose(0, 1)
      char_cnn_output = self.char_layer_norm(char_cnn_output)
      return char_cnn_output
  
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 2 for calling the CharAwareHybridRNNDecoder obj's underlying member method code with example usage: obj._get_char_cnn_output(char_inds) and returns: char_cnn_output