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","."]
docstr: If the embeddings are precomputed for character compositions (this holds
  in inference), use the cached embeddings, otherwise compute it.
docstr_tok: ["If","the","embeddings","are","precomputed","for","character","compositions","(","this","holds","in","inference",")",",","use","the","cached","embeddings",",","otherwise","compute","it","."]
code: def _combined_word_char_embed(
      self, prev_output_tokens, prev_output_chars
  ):
      """
      If the embeddings are precomputed for character compositions (this holds
      in inference), use the cached embeddings, otherwise compute it.
      """
      if self._is_precomputed:
          combined_embedding = (
              self.combined_word_char_embed(prev_output_tokens)
              .squeeze(1)
              .unsqueeze(0)
          )
      else:
          x = self.embed_tokens(prev_output_tokens)
          x = F.dropout(x, p=self.dropout, training=self.training)
          # B x T x C -> T x B x C
          x = x.transpose(0, 1)
          char_cnn_output = self._get_char_cnn_output(prev_output_chars)
          combined_embedding = x + char_cnn_output
      return combined_embedding
  
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 4 for calling the CharAwareHybridRNNDecoder obj's underlying member method code with example usage: obj._combined_word_char_embed(prev_output_tokens, prev_output_chars) and returns: combined_embedding