code: def check_encoder_decoder_model_generate(
      self, pixel_values, config, decoder_config, **kwargs
  ):
      encoder_model, decoder_model = self.get_encoder_decoder_model(
          config, decoder_config
      )
      enc_dec_model = TFVisionEncoderDecoderModel(
          encoder=encoder_model, decoder=decoder_model
      )
  
      # Generate until max length
      if hasattr(enc_dec_model.config, "eos_token_id"):
          enc_dec_model.config.eos_token_id = None
      if hasattr(enc_dec_model.config, "decoder") and hasattr(
          enc_dec_model.config.decoder, "eos_token_id"
      ):
          enc_dec_model.config.decoder.eos_token_id = None
  
      # Bert does not have a bos token id, so use pad_token_id instead
      generated_output = enc_dec_model.generate(
          pixel_values,
          decoder_start_token_id=enc_dec_model.config.decoder.pad_token_id,
      )
      self.assertEqual(
          tuple(generated_output.shape.as_list()),
          (pixel_values.shape[0],) + (decoder_config.max_length,),
      )
  
imports: from __future__ import annotations
  import copy
  import os
  import tempfile
  import unittest
  import numpy
  from transformers import is_tf_available, is_torch_available, is_vision_available
  from transformers.testing_utils import is_pt_tf_cross_test, require_tf, require_torch, require_vision, slow, torch_device
  from transformers.utils.generic import ModelOutput
  from ...test_modeling_tf_common import floats_tensor, ids_tensor
  from ..gpt2.test_modeling_tf_gpt2 import TFGPT2ModelTester
  from ..vit.test_modeling_tf_vit import TFViTModelTester
label_desc: Use image node_id 10 for calling the TFVisionEncoderDecoderMixin obj's underlying member method code with example usage: obj.check_encoder_decoder_model_generate(pixel_values, config, decoder_config) without return types