class_docstr: A class containing all of the functions supporting generation, to be used as a mixin in
  :class:`~transformers.PreTrainedModel`.
class_docstr_tok: ["A","class","containing","all","of","the","functions","supporting","generation",",","to","be","used","as","a","mixin","in",":","class",":","`","~transformers.PreTrainedModel","`","."]
docstr: This class returns a :obj:`~transformers.LogitsProcessorList` list object that contains all relevant
  :obj:`~transformers.LogitsWarper` instances used for multinomial sampling.
docstr_tok: ["This","class","returns","a",":","obj",":","`","~transformers.LogitsProcessorList","`","list","object","that","contains","all","relevant",":","obj",":","`","~transformers.LogitsWarper","`","instances","used","for","multinomial","sampling","."]
code: def _get_logits_warper(
      self,
      top_k: int = None,
      top_p: float = None,
      temperature: float = None,
      num_beams: int = None,
  ) -> LogitsProcessorList:
      """
      This class returns a :obj:`~transformers.LogitsProcessorList` list object that contains all relevant
      :obj:`~transformers.LogitsWarper` instances used for multinomial sampling.
      """
  
      # init warp parameters
      top_k = top_k if top_k is not None else self.config.top_k
      top_p = top_p if top_p is not None else self.config.top_p
      temperature = (
          temperature
          if temperature is not None
          else self.config.temperature
      )
      # instantiate warpers list
      warpers = LogitsProcessorList()
  
      # the following idea is largely copied from this PR: https://github.com/huggingface/transformers/pull/5420/files
      # all samplers can be found in `generation_utils_samplers.py`
      if temperature is not None and temperature != 1.0:
          warpers.append(TemperatureLogitsWarper(temperature))
      if top_k is not None and top_k != 0:
          warpers.append(
              TopKLogitsWarper(
                  top_k=top_k,
                  min_tokens_to_keep=(2 if num_beams > 1 else 1),
              )
          )
      if top_p is not None and top_p < 1.0:
          warpers.append(
              TopPLogitsWarper(
                  top_p=top_p,
                  min_tokens_to_keep=(2 if num_beams > 1 else 1),
              )
          )
      return warpers
  
imports: from dataclasses import dataclass
  from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union
  from .file_utils import ModelOutput
  from .generation_beam_search import BeamScorer, BeamSearchScorer
  from .generation_logits_process import EncoderNoRepeatNGramLogitsProcessor, ForcedBOSTokenLogitsProcessor, ForcedEOSTokenLogitsProcessor, HammingDiversityLogitsProcessor, InfNanRemoveLogitsProcessor, LogitsProcessorList, MinLengthLogitsProcessor, NoBadWordsLogitsProcessor, NoRepeatNGramLogitsProcessor, PrefixConstrainedLogitsProcessor, RepetitionPenaltyLogitsProcessor, TemperatureLogitsWarper, TopKLogitsWarper, TopPLogitsWarper
  from .generation_stopping_criteria import MaxLengthCriteria, MaxNewTokensCriteria, MaxTimeCriteria, StoppingCriteriaList, validate_stopping_criteria
  from fastNLP.envs.imports import _NEED_IMPORT_TORCH
  from fastNLP.core.log import logger
label_desc: Use image node_id 12 for calling the GenerationMixin obj's underlying member method code with example usage: obj._get_logits_warper(top_k, top_p, temperature, num_beams) and returns: warpers