code: def forward_decoder(
      self,
      decoder_out,
      encoder_out,
      eos_penalty=0.0,
      max_ratio=None,
      **kwargs,
  ):
      output_tokens = decoder_out.output_tokens
      output_scores = decoder_out.output_scores
      history = decoder_out.history
  
      # TODO: decoding for InsertionTransformer
      word_ins_score = self.decoder.forward_word_ins(
          normalize=True,
          prev_output_tokens=output_tokens,
          encoder_out=encoder_out,
      )
  
      if eos_penalty > 0.0:
          word_ins_score[:, :, self.pad] -= eos_penalty
      word_ins_score, word_ins_pred = word_ins_score.max(-1)
      output_tokens, output_scores = _apply_ins_words(
          output_tokens,
          output_scores,
          word_ins_pred,
          word_ins_score,
          self.pad,
      )
  
      # delete some unnecessary paddings
      cut_off = output_tokens.ne(self.pad).sum(1).max()
      output_tokens = output_tokens[:, :cut_off]
      output_scores = output_scores[:, :cut_off]
  
      if history is not None:
          history.append(output_tokens.clone())
  
      return decoder_out._replace(
          output_tokens=output_tokens,
          output_scores=output_scores,
          attn=None,
          history=history,
      )
  
imports: import numpy
  import torch
  import torch.nn.functional
  from fairseq.models import register_model, register_model_architecture
  from fairseq.models.nat import FairseqNATModel, LevenshteinTransformerDecoder, LevenshteinTransformerModel, ensemble_decoder
  from fairseq.models.transformer import Linear
  from fairseq.modules.transformer_sentence_encoder import init_bert_params
  from fairseq.utils import new_arange
label_desc: Use image node_id 5 for calling the InsertionTransformerModel obj's underlying member method code with example usage: obj.forward_decoder(decoder_out, encoder_out, eos_penalty, max_ratio) and returns: decoder_out