docstr: force one of token_ids to be generated by setting prob of all other tokens to 0 (logprob=-float("inf"))
code: def _force_token_id_to_be_generated(scores, token_id: int):
      """force one of token_ids to be generated by setting prob of all other tokens to 0 (logprob=-float("inf"))"""
      mask = torch.full_like(scores, 1, dtype=torch.bool)
      mask[:, token_id] = False
      return scores.masked_fill(mask, -float("inf"))
  
imports: import copy
  import itertools
  from typing import List, Optional, Tuple
  import torch
  import torch.nn.functional
  from transformers import BartConfig
  from transformers.generation import GenerationMixin
label_desc: Use image node_id 4 for calling the BARTBeamSearchGenerator obj's underlying member method code with example usage: obj._force_token_id_to_be_generated(scores, token_id) and returns: scores