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 = (
          FlaxVisionEncoderDecoderModel.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,
      )
  
      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: import tempfile
  import unittest
  import numpy
  from transformers import is_flax_available, is_torch_available, is_vision_available
  from transformers.testing_utils import is_pt_flax_cross_test, require_flax, require_vision, slow, torch_device
  from ...test_modeling_flax_common import floats_tensor, ids_tensor
  from ..gpt2.test_modeling_flax_gpt2 import FlaxGPT2ModelTester
  from ..vit.test_modeling_flax_vit import FlaxViTModelTester
label_desc: Use image node_id 5 for calling the FlaxEncoderDecoderMixin 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