class_docstr: A complete encoder-decoder model, with optional attention.
  
  A parent class which makes use of the contextual_embedding (such as a charlm)
  can make use of unsaved_modules when saving.
class_docstr_tok: ["A","complete","encoder-decoder","model",",","with","optional","attention",".","A","parent","class","which","makes","use","of","the","contextual_embedding","(","such","as","a","charlm",")","can","make","use","of","unsaved_modules","when","saving","."]
code: def get_log_prob(self, logits):
      logits_reshape = logits.view(-1, self.vocab_size)
      log_probs = F.log_softmax(logits_reshape, dim=1)
      if logits.dim() == 2:
          return log_probs
      return log_probs.view(
          logits.size(0), logits.size(1), logits.size(2)
      )
  
imports: import logging
  import torch
  from torch import nn
  import torch.nn.functional
  import numpy
  import stanza.models.common.seq2seq_constant
  from stanza.models.common import utils
  from stanza.models.common.seq2seq_modules import LSTMAttention
  from stanza.models.common.beam import Beam
label_desc: Use image node_id 9 for calling the Seq2SeqModel obj's underlying member method code with example usage: obj.get_log_prob(logits) and returns: log_probs, log_probs