class_docstr: [`TFLogitsProcessor`] that enforces that specified sequences will never be sampled.
  
  Args:
      bad_words_ids (`List[List[int]]`):
          List of list of token ids that are not allowed to be generated. In order to get the tokens of the words
          that should not appear in the generated text, make sure to set `add_prefix_space=True` when initializing
          the tokenizer, and use `tokenizer(bad_words, add_special_tokens=False).input_ids`. The `add_prefix_space`
          argument is only supported for some slow tokenizers, as fast tokenizers' prefixing behaviours come from
          `pre tokenizers`. Read more [here](https://huggingface.co/docs/tokenizers/api/pre-tokenizers).
      eos_token_id (`int`):
          The id of the *end-of-sequence* token.
class_docstr_tok: ["[","`","TFLogitsProcessor","`","]","that","enforces","that","specified","sequences","will","never","be","sampled",".","Args",":","bad_words_ids","(","`","List","[","List","[","int","]","]","`",")",":","List","of","list","of","token","ids","that","are","not","allowed","to","be","generated",".","In","order","to","get","the","tokens","of","the","words","that","should","not","appear","in","the","generated","text",",","make","sure","to","set","`","add_prefix_space=True","`","when","initializing","the","tokenizer",",","and","use","`","tokenizer","(","bad_words",",","add_special_tokens=False",")",".input_ids","`",".","The","`","add_prefix_space","`","argument","is","only","supported","for","some","slow","tokenizers",",","as","fast","tokenizers","'","prefixing","behaviours","come","from","`","pre","tokenizers","`",".","Read","more","[","here","]","(","https",":","\/\/huggingface.co\/docs\/tokenizers\/api\/pre-tokenizers",")",".","eos_token_id","(","`","int","`",")",":","The","id","of","the","*","end-of-sequence","*","token","."]
code: def __call__(
      self, input_ids: tf.Tensor, scores: tf.Tensor, cur_len: int
  ) -> tf.Tensor:
      # We want to mask some banned tokens, at a score level. Since the banned tokens depend on the previous
      # `input_ids`, they may have a different length for each row, and they may even be empty for some rows.
      # To remain simple and XLA-compatible, we work on a per-row fashion.
      # TODO (Joao): this function might trigger XLA retracing as `cur_len` increases. Fix it if it becomes
      # a frequent choke point. (make `cur_len` a tensor?)
      def _get_row_updated_score(
          row_inputs: Tuple[tf.Tensor],
      ) -> tf.Tensor:
          row_input_ids, row_score = row_inputs
          banned_tokens = self._calc_row_banned_bad_tokens(
              row_input_ids[:cur_len]
          )
          banned_tokens_mask = tf.scatter_nd(
              indices=tf.expand_dims(banned_tokens, axis=-1),
              updates=tf.ones_like(banned_tokens, dtype=tf.bool),
              shape=row_score.shape,
          )
          row_score = tf.where(
              banned_tokens_mask, -float("inf"), row_score
          )
          return row_score
  
      scores = tf.map_fn(
          _get_row_updated_score,
          (input_ids, scores),
          fn_output_signature=tf.float32,
      )
      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 3 for calling the TFNoBadWordsLogitsProcessor obj's underlying member method code with example usage: obj.__call__(input_ids, scores, cur_len) and returns: scores, row_score