class_docstr: A class containing all functions for auto-regressive text generation, to be used as a mixin in
  [`FlaxPreTrainedModel`].
  
  The class exposes [`~generation_flax_utils.FlaxGenerationMixin.generate`], which can be used for:
          - *greedy decoding* by calling [`~generation_flax_utils.FlaxGenerationMixin._greedy_search`] if
            `num_beams=1` and `do_sample=False`.
          - *multinomial sampling* by calling [`~generation_flax_utils.FlaxGenerationMixin._sample`] if `num_beams=1`
            and `do_sample=True`.
          - *beam-search decoding* by calling [`~generation_utils.FlaxGenerationMixin._beam_search`] if `num_beams>1`
            and `do_sample=False`.
class_docstr_tok: ["A","class","containing","all","functions","for","auto-regressive","text","generation",",","to","be","used","as","a","mixin","in","[","`","FlaxPreTrainedModel","`","]",".","The","class","exposes","[","`","~generation_flax_utils.FlaxGenerationMixin.generate","`","]",",","which","can","be","used","for",":","-","*","greedy","decoding","*","by","calling","[","`","~generation_flax_utils.FlaxGenerationMixin._greedy_search","`","]","if","`","num_beams=1","`","and","`","do_sample=False","`",".","-","*","multinomial","sampling","*","by","calling","[","`","~generation_flax_utils.FlaxGenerationMixin._sample","`","]","if","`","num_beams=1","`","and","`","do_sample=True","`",".","-","*","beam-search","decoding","*","by","calling","[","`","~generation_utils.FlaxGenerationMixin._beam_search","`","]","if","`","num_beams",">","1","`","and","`","do_sample=False","`","."]
docstr: This class returns a [`FlaxLogitsProcessorList`] list object that contains all relevant [`FlaxLogitsWarper`]
  instances used for multinomial sampling.
docstr_tok: ["This","class","returns","a","[","`","FlaxLogitsProcessorList","`","]","list","object","that","contains","all","relevant","[","`","FlaxLogitsWarper","`","]","instances","used","for","multinomial","sampling","."]
code: def _get_logits_warper(
      self,
      top_k: Optional[int] = None,
      top_p: Optional[float] = None,
      temperature: Optional[float] = None,
  ) -> FlaxLogitsProcessorList:
      """
      This class returns a [`FlaxLogitsProcessorList`] list object that contains all relevant [`FlaxLogitsWarper`]
      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 = FlaxLogitsProcessorList()
  
      # 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(FlaxTemperatureLogitsWarper(temperature))
      if top_k is not None and top_k != 0:
          warpers.append(
              FlaxTopKLogitsWarper(top_k=top_k, min_tokens_to_keep=1)
          )
      if top_p is not None and top_p < 1.0:
          warpers.append(
              FlaxTopPLogitsWarper(top_p=top_p, min_tokens_to_keep=1)
          )
  
      return warpers
  
imports: import inspect
  import warnings
  from functools import partial
  from typing import Any, Dict, Optional
  import numpy
  import flax
  import jax
  import jax.numpy
  from jax import lax
  from .generation_flax_logits_process import FlaxForcedBOSTokenLogitsProcessor, FlaxForcedEOSTokenLogitsProcessor, FlaxLogitsProcessorList, FlaxMinLengthLogitsProcessor, FlaxTemperatureLogitsWarper, FlaxTopKLogitsWarper, FlaxTopPLogitsWarper
  from .models.auto import FLAX_MODEL_FOR_CAUSAL_LM_MAPPING, FLAX_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING, FLAX_MODEL_FOR_VISION_2_SEQ_MAPPING
  from .utils import ModelOutput, logging
label_desc: Use image node_id 8 for calling the FlaxGenerationMixin obj's underlying member method code with example usage: obj._get_logits_warper(top_k, top_p, temperature) and returns: warpers