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","`","]","."]
code: def _prepare_decoder_input_ids_for_generation(
      self,
      batch_size: int,
      decoder_start_token_id: int = None,
      bos_token_id: int = None,
      model_kwargs: Optional[Dict[str, tf.Tensor]] = None,
  ) -> tf.Tensor:
      # prepare `input_ids` for decoder if model is encoder-decoder
      if (
          model_kwargs is not None
          and "decoder_input_ids" in model_kwargs
      ):
          return model_kwargs.pop("decoder_input_ids")
      else:
          decoder_start_token_id = self._get_decoder_start_token_id(
              decoder_start_token_id, bos_token_id
          )
          return (
              tf.ones((batch_size, 1), dtype=tf.int32)
              * decoder_start_token_id
          )
  
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 13 for calling the TFGenerationMixin obj's underlying member method code with example usage: obj._prepare_decoder_input_ids_for_generation(batch_size, decoder_start_token_id, bos_token_id, model_kwargs) and returns: model_kwargs, unknown