code: def decoder_input_ids_to_vocab_mask(
      self, action_logits, decoder_input_ids, input_ids
  ):
      # counting how many words have been copied
      is_copied = (decoder_input_ids != self.mention_start_id) & (
          decoder_input_ids != self.mention_end_id
      )
  
      # compute pointer to input tokens
      # (batch_size, 1)
      num_copied = is_copied.sum(dim=-1, keepdim=True) - 1
      num_copied = num_copied.clamp(max=input_ids.size(1) - 1)
  
      lm_logits = action_logits.new_full(
          (
              action_logits.size(0),
              action_logits.size(1),
              self.config.vocab_size,
          ),
          float("-inf"),
      )
      word_to_copy = input_ids.expand(
          num_copied.size(0), -1
      )  # repeating over beams
      word_to_copy = word_to_copy.gather(1, num_copied)
      # scattering action logits into vocab logits
      lm_logits.scatter_(
          2, word_to_copy.unsqueeze(-1), action_logits[:, :, :1]
      )
      lm_logits[:, :, self.mention_start_id] = action_logits[:, :, 1]
      lm_logits[:, :, self.mention_end_id] = action_logits[:, :, 2]
  
      return lm_logits
  
imports: import sys
  import os
  from typing import Optional, Tuple, Any, Dict, Iterable
  import logging
  import torch
  import torch.utils.checkpoint
  from torch import nn
  import torch.nn.init
  import torch.nn.functional
  from transformers.models.t5.modeling_t5 import T5PreTrainedModel, T5Model, T5_INPUTS_DOCSTRING, _CONFIG_FOR_DOC
  from transformers.file_utils import add_start_docstrings_to_model_forward, replace_return_docstrings
  from .modeling_outputs import MySeq2SeqLMOutput
  from util import logsumexp, dummy_padding, prepare_pair_embeddings, one_hot_ignore_negative, batched_masked_select
label_desc: Use image node_id 5 for calling the T5Coref obj's underlying member method code with example usage: obj.decoder_input_ids_to_vocab_mask(action_logits, decoder_input_ids, input_ids) and returns: lm_logits