class_docstr: A class containing all of the functions supporting generation, to be used as a mixin in [`TFPreTrainedModel`].
class_docstr_tok: ["A","class","containing","all","of","the","functions","supporting","generation",",","to","be","used","as","a","mixin","in","[","`","TFPreTrainedModel","`","]","."]
docstr: This class returns a [`TFLogitsProcessorList`] list object that contains all relevant [`TFLogitsProcessor`]
  instances used to modify the scores of the language model head.
code: def _get_logits_processor(
      self,
      repetition_penalty: float,
      no_repeat_ngram_size: int,
      input_ids_seq_length: int,
      bad_words_ids: List[List[int]],
      min_length: int,
      max_length: int,
      eos_token_id: int,
      forced_bos_token_id: int,
      forced_eos_token_id: int,
      suppress_tokens: Optional[List[int]] = None,
      begin_suppress_tokens: Optional[List[int]] = None,
      forced_decoder_ids: Optional[List[List[int]]] = None,
  ) -> TFLogitsProcessorList:
      """
      This class returns a [`TFLogitsProcessorList`] list object that contains all relevant [`TFLogitsProcessor`]
      instances used to modify the scores of the language model head.
      """
      processors = TFLogitsProcessorList()
  
      repetition_penalty = (
          repetition_penalty
          if repetition_penalty is not None
          else self.config.repetition_penalty
      )
      no_repeat_ngram_size = (
          no_repeat_ngram_size
          if no_repeat_ngram_size is not None
          else self.config.no_repeat_ngram_size
      )
      bad_words_ids = (
          bad_words_ids
          if bad_words_ids is not None
          else self.config.bad_words_ids
      )
      eos_token_id = (
          eos_token_id
          if eos_token_id is not None
          else self.config.eos_token_id
      )
      suppress_tokens = (
          suppress_tokens
          if suppress_tokens is not None
          else self.config.suppress_tokens
      )
      begin_suppress_tokens = (
          begin_suppress_tokens
          if begin_suppress_tokens is not None
          else self.config.begin_suppress_tokens
      )
      if forced_decoder_ids is None and hasattr(
          self.config, "forced_decoder_ids"
      ):
          forced_decoder_ids = self.config.forced_decoder_ids
  
      # instantiate processors list
      if repetition_penalty is not None and repetition_penalty != 1.0:
          processors.append(
              TFRepetitionPenaltyLogitsProcessor(
                  penalty=repetition_penalty
              )
          )
      if no_repeat_ngram_size is not None and no_repeat_ngram_size > 0:
          processors.append(
              TFNoRepeatNGramLogitsProcessor(no_repeat_ngram_size)
          )
      if bad_words_ids is not None:
          processors.append(
              TFNoBadWordsLogitsProcessor(bad_words_ids, eos_token_id)
          )
      if (
          min_length is not None
          and eos_token_id is not None
          and min_length > 0
      ):
          processors.append(
              TFMinLengthLogitsProcessor(min_length, eos_token_id)
          )
      if forced_bos_token_id is not None:
          processors.append(
              TFForcedBOSTokenLogitsProcessor(forced_bos_token_id)
          )
      if forced_eos_token_id is not None:
          processors.append(
              TFForcedEOSTokenLogitsProcessor(
                  max_length, forced_eos_token_id
              )
          )
      if suppress_tokens is not None:
          processors.append(
              TFSuppressTokensLogitsProcessor(suppress_tokens)
          )
      if begin_suppress_tokens is not None:
          begin_index = input_ids_seq_length
          begin_index = (
              begin_index
              if (
                  input_ids_seq_length > 1
                  or forced_bos_token_id is None
              )
              else begin_index + 1
          )
          if forced_decoder_ids is not None:
              begin_index += forced_decoder_ids[-1][
                  0
              ]  # generation starts after the last token that is forced
          processors.append(
              TFSuppressTokensAtBeginLogitsProcessor(
                  begin_suppress_tokens, begin_index
              )
          )
      if forced_decoder_ids is not None:
          processors.append(
              TFForceTokensLogitsProcessor(forced_decoder_ids)
          )
      return processors
  
imports: import inspect
  import warnings
  from dataclasses import dataclass
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  import tensorflow
  from tensorflow.compiler.tf2xla.python.xla import dynamic_update_slice
  from .generation_tf_logits_process import TFForcedBOSTokenLogitsProcessor, TFForcedEOSTokenLogitsProcessor, TFForceTokensLogitsProcessor, TFLogitsProcessorList, TFMinLengthLogitsProcessor, TFNoBadWordsLogitsProcessor, TFNoRepeatNGramLogitsProcessor, TFRepetitionPenaltyLogitsProcessor, TFSuppressTokensAtBeginLogitsProcessor, TFSuppressTokensLogitsProcessor, TFTemperatureLogitsWarper, TFTopKLogitsWarper, TFTopPLogitsWarper
  from .models.auto import TF_MODEL_FOR_CAUSAL_LM_MAPPING, TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING, TF_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING, TF_MODEL_FOR_VISION_2_SEQ_MAPPING
  from .tf_utils import shape_list, stable_softmax
  from .utils import ModelOutput, logging
label_desc: Use image node_id 20 for calling the TFGenerationMixin obj's underlying member method code with example usage: obj._get_logits_processor(repetition_penalty, no_repeat_ngram_size, input_ids_seq_length, bad_words_ids, min_length, max_length, eos_token_id, forced_bos_token_id, forced_eos_token_id, suppress_tokens, begin_suppress_tokens, forced_decoder_ids) and returns: processors