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 __call__(
      self, input_ids: tf.Tensor, scores: tf.Tensor, cur_len: int
  ) -> tf.Tensor:
      def _force_token(generation_idx):
          batch_size = scores.shape[0]
          current_token = self.force_token_array[generation_idx]
  
          new_scores = tf.ones_like(
              scores, dtype=scores.dtype
          ) * -float("inf")
          indices = tf.stack(
              (
                  tf.range(batch_size),
                  tf.tile([current_token], [batch_size]),
              ),
              axis=1,
          )
          updates = tf.zeros((batch_size,), dtype=scores.dtype)
          new_scores = tf.tensor_scatter_nd_update(
              new_scores, indices, updates
          )
          return new_scores
  
      scores = tf.cond(
          tf.greater_equal(
              cur_len, tf.shape(self.force_token_array)[0]
          ),
          # If the current length is geq than the length of force_token_array, the processor does nothing.
          lambda: tf.identity(scores),
          # Otherwise, it may force a certain token.
          lambda: tf.cond(
              tf.greater_equal(self.force_token_array[cur_len], 0),
              # Only valid (positive) tokens are forced
              lambda: _force_token(cur_len),
              # Otherwise, the processor does nothing.
              lambda: scores,
          ),
      )
      return scores
  
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 2 for calling the TFForceTokensLogitsProcessor obj's underlying member method code with example usage: obj.__call__(input_ids, scores, cur_len) and returns: scores, new_scores