class_docstr: This processor takes a list of pairs of integers which indicates a mapping from generation indices to token
  indices that will be forced before sampling. The processor will set their log probs to `0` and all other tokens to
  `-inf` so that they are sampled at their corresponding index.
class_docstr_tok: ["This","processor","takes","a","list","of","pairs","of","integers","which","indicates","a","mapping","from","generation","indices","to","token","indices","that","will","be","forced","before","sampling",".","The","processor","will","set","their","log","probs","to","`","0","`","and","all","other","tokens","to","`","-inf","`","so","that","they","are","sampled","at","their","corresponding","index","."]
code: def __init__(self, force_token_map: List[List[int]]):
      force_token_map = dict(force_token_map)
      # Converts the dictionary of format {index: token} containing the tokens to be forced to an array, where the
      # index of the array corresponds to the index of the token to be forced, for XLA compatibility.
      # Indexes without forced tokens will have an negative value.
      force_token_array = (
          np.ones((max(force_token_map.keys()) + 1), dtype=np.int32)
          * -1
      )
      for index, token in force_token_map.items():
          if token is not None:
              force_token_array[index] = token
      self.force_token_array = tf.convert_to_tensor(
          force_token_array, dtype=tf.int32
      )
  
imports: import inspect
  from typing import List, Tuple
  import numpy
  import tensorflow
  from ..tf_utils import stable_softmax
  from ..utils import add_start_docstrings
  from ..utils.logging import get_logger
label_desc: Use image node_id 1 to create a new TFForceTokensLogitsProcessor object from inherited base classes: TFLogitsProcessor with example: obj = TFForceTokensLogitsProcessor(force_token_map)