code: def check_decoder_model_past_large_inputs(self, config, inputs_dict):
      model = TFBartModel(config=config).get_decoder()
      input_ids = inputs_dict["input_ids"]
  
      input_ids = input_ids[:1, :]
      attention_mask = inputs_dict["attention_mask"][:1, :]
      head_mask = inputs_dict["head_mask"]
      self.batch_size = 1
  
      # first forward pass
      outputs = model(
          input_ids,
          attention_mask=attention_mask,
          head_mask=head_mask,
          use_cache=True,
      )
  
      output, past_key_values = outputs.to_tuple()
  
      # create hypothetical next token and extent to next_input_ids
      next_tokens = ids_tensor((self.batch_size, 3), config.vocab_size)
      next_attn_mask = tf.cast(
          ids_tensor((self.batch_size, 3), 2), tf.int8
      )
  
      # append to next input_ids and
      next_input_ids = tf.concat([input_ids, next_tokens], axis=-1)
      next_attention_mask = tf.concat(
          [attention_mask, next_attn_mask], axis=-1
      )
  
      output_from_no_past = model(
          next_input_ids, attention_mask=next_attention_mask
      )
      output_from_no_past = output_from_no_past[0]
  
      output_from_past = model(
          next_tokens,
          attention_mask=next_attention_mask,
          past_key_values=past_key_values,
      )
      output_from_past = output_from_past[0]
  
      self.parent.assertEqual(
          next_tokens.shape[1], output_from_past.shape[1]
      )
  
      # select random slice
      random_slice_idx = int(
          ids_tensor((1,), output_from_past.shape[-1])
      )
      output_from_no_past_slice = output_from_no_past[
          :, -3:, random_slice_idx
      ]
      output_from_past_slice = output_from_past[:, :, random_slice_idx]
  
      # test that outputs are equal for slice
      tf.debugging.assert_near(
          output_from_past_slice, output_from_no_past_slice, rtol=1e-3
      )
  
imports: import unittest
  import numpy
  from transformers import BartConfig, BartTokenizer, is_tf_available
  from transformers.testing_utils import require_tf, slow, tooslow
  from transformers.utils import cached_property
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor
  from ...utils.test_modeling_tf_core import TFCoreModelTesterMixin
label_desc: Use image node_id 3 for calling the TFBartModelTester obj's underlying member method code with example usage: obj.check_decoder_model_past_large_inputs(config, inputs_dict) without return types