class_docstr: A wrapper around an ensemble of models.
class_docstr_tok: ["A","wrapper","around","an","ensemble","of","models","."]
code: def forward_mask_ins(
      self,
      encoder_outs,
      output_tokens,
      output_scores,
      can_ins_mask,
      eos_penalty,
      max_lens,
  ):
      mask_ins_score_avg = []
      for model, encoder_out in zip(self.models, encoder_outs):
          mask_ins_out, _ = model.decoder.forward_mask_ins(
              _skip(output_tokens, can_ins_mask),
              _skip_encoder_out(
                  model.encoder, encoder_out, can_ins_mask
              ),
          )
          mask_ins_score = F.log_softmax(mask_ins_out, 2)
          if eos_penalty > 0.0:
              mask_ins_score[:, :, 0] -= eos_penalty
          mask_ins_score_avg.append(mask_ins_score)
      mask_ins_score_avg = torch.logsumexp(
          torch.stack(mask_ins_score_avg, dim=0), dim=0
      ) - math.log(len(self.models))
      mask_ins_pred = mask_ins_score_avg.max(-1)[1]
      mask_ins_pred = torch.min(
          mask_ins_pred,
          max_lens[can_ins_mask, None].expand_as(mask_ins_pred),
      )
      _tokens, _scores = _apply_ins_masks(
          output_tokens[can_ins_mask],
          output_scores[can_ins_mask],
          mask_ins_pred,
          self.pad,
          self.unk,
          self.eos,
      )
      output_tokens = _fill(
          output_tokens, can_ins_mask, _tokens, self.pad
      )
      output_scores = _fill(output_scores, can_ins_mask, _scores, 0)
      return output_tokens, output_scores
  
imports: import math
  import torch
  import torch.nn.functional
  from fairseq.models.nat import _apply_del_words, _apply_ins_masks, _apply_ins_words, _fill, _skip, _skip_encoder_out
label_desc: Use image node_id 4 for calling the EnsembleLevT obj's underlying member method code with example usage: obj.forward_mask_ins(encoder_outs, output_tokens, output_scores, can_ins_mask, eos_penalty, max_lens) and returns: output_tokens,  output_scores