code: def check_encoder_decoder_model_from_pretrained(
      self,
      config,
      pixel_values,
      encoder_hidden_states,
      decoder_config,
      decoder_input_ids,
      decoder_attention_mask,
      return_dict,
      **kwargs,
  ):
      encoder_model, decoder_model = self.get_encoder_decoder_model(
          config, decoder_config
      )
      kwargs = {
          "encoder_model": encoder_model,
          "decoder_model": decoder_model,
          "return_dict": return_dict,
      }
      enc_dec_model = (
          TFVisionEncoderDecoderModel.from_encoder_decoder_pretrained(
              **kwargs
          )
      )
      outputs_encoder_decoder = enc_dec_model(
          pixel_values=pixel_values,
          decoder_input_ids=decoder_input_ids,
          decoder_attention_mask=decoder_attention_mask,
          return_dict=True,
          kwargs=kwargs,
      )
  
      self.assertEqual(
          outputs_encoder_decoder["logits"].shape,
          (decoder_input_ids.shape + (decoder_config.vocab_size,)),
      )
      self.assertEqual(
          outputs_encoder_decoder["encoder_last_hidden_state"].shape[0],
          pixel_values.shape[0],
      )
      self.assertEqual(
          outputs_encoder_decoder["encoder_last_hidden_state"].shape[
              -1
          ],
          config.hidden_size,
      )
  
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 6 for calling the TFVisionEncoderDecoderMixin obj's underlying member method code with example usage: obj.check_encoder_decoder_model_from_pretrained(config, pixel_values, encoder_hidden_states, decoder_config, decoder_input_ids, decoder_attention_mask, return_dict) without return types