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 forward(self, src, src_mask, tgt_in, pos=None, raw=None):
      # prepare for encoder/decoder
      enc_inputs, batch_size, src_lens, src_mask = self.embed(
          src, src_mask, pos, raw
      )
  
      # encode source
      h_in, (hn, cn) = self.encode(enc_inputs, src_lens)
  
      if self.edit:
          edit_logits = self.edit_clf(hn)
      else:
          edit_logits = None
  
      dec_inputs = self.emb_drop(self.embedding(tgt_in))
  
      log_probs, _ = self.decode(
          dec_inputs, hn, cn, h_in, src_mask, src=src
      )
      return log_probs, edit_logits
  
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 8 for calling the Seq2SeqModel obj's underlying member method code with example usage: obj.forward(src, src_mask, tgt_in, pos, raw) and returns: log_probs,  edit_logits