code: def __init__(
      self,
      parent,
      batch_size=1,
      seq_length=7,
      image_size=30,
      patch_size=2,
      num_channels=3,
      is_training=True,
      use_input_mask=True,
      use_token_type_ids=True,
      use_labels=True,
      vocab_size=99,
      hidden_size=32,
      num_hidden_layers=5,
      num_attention_heads=4,
      intermediate_size=37,
      hidden_act="gelu",
      hidden_dropout_prob=0.1,
      attention_probs_dropout_prob=0.1,
      max_position_embeddings=512,
      type_vocab_size=16,
      type_sequence_label_size=2,
      initializer_range=0.02,
      alpha_initializer="ones",
      num_labels=3,
      scope=None,
      modality_type_vocab_size=2,
      vision_embed_dim=32,
      vision_patch_size=2,
      vision_image_size=30,
      vision_num_attention_heads=4,
      vision_num_hidden_layers=5,
      vision_intermediate_size=37,
      perceiver_qk_layer_norms_perceiver=False,
      perceiver_resampler_depth=2,
      perceiver_resampler_head_dim=8,
      perceiver_resampler_n_heads=2,
      perceiver_resampler_n_latents=16,
  ):
      self.parent = parent
      self.batch_size = batch_size
      self.seq_length = seq_length
      self.image_size = image_size
      self.patch_size = patch_size
      self.num_channels = num_channels
      self.is_training = is_training
      self.use_input_mask = use_input_mask
      self.use_token_type_ids = use_token_type_ids
      self.use_labels = use_labels
      self.vocab_size = vocab_size
      self.hidden_size = hidden_size
      self.num_hidden_layers = num_hidden_layers
      self.num_attention_heads = num_attention_heads
      self.intermediate_size = intermediate_size
      self.hidden_act = hidden_act
      self.hidden_dropout_prob = hidden_dropout_prob
      self.attention_probs_dropout_prob = attention_probs_dropout_prob
      self.max_position_embeddings = max_position_embeddings
      self.type_vocab_size = type_vocab_size
      self.type_sequence_label_size = type_sequence_label_size
      self.initializer_range = initializer_range
      self.alpha_initializer = alpha_initializer
      self.num_labels = num_labels
      self.scope = scope
      self.modality_type_vocab_size = modality_type_vocab_size
  
      self.vision_embed_dim = vision_embed_dim
      self.vision_patch_size = vision_patch_size
      self.vision_image_size = vision_image_size
      self.vision_num_attention_heads = vision_num_attention_heads
      self.vision_num_hidden_layers = vision_num_hidden_layers
      self.vision_intermediate_size = vision_intermediate_size
  
      self.vision_config = IdeficsVisionConfig(
          embed_dim=self.vision_embed_dim,
          patch_size=self.vision_patch_size,
          image_size=self.vision_image_size,
          num_attention_heads=self.vision_num_attention_heads,
          num_hidden_layers=self.vision_num_hidden_layers,
          intermediate_size=self.vision_intermediate_size,
      )
  
      self.perceiver_qk_layer_norms_perceiver = (
          perceiver_qk_layer_norms_perceiver
      )
      self.perceiver_resampler_depth = perceiver_resampler_depth
      self.perceiver_resampler_head_dim = perceiver_resampler_head_dim
      self.perceiver_resampler_n_heads = perceiver_resampler_n_heads
      self.perceiver_resampler_n_latents = perceiver_resampler_n_latents
  
      self.perceiver_config = IdeficsPerceiverConfig(
          qk_layer_norms_perceiver=self.perceiver_qk_layer_norms_perceiver,
          resampler_depth=self.perceiver_resampler_depth,
          resampler_head_dim=self.perceiver_resampler_head_dim,
          resampler_n_heads=self.perceiver_resampler_n_heads,
          resampler_n_latents=self.perceiver_resampler_n_latents,
      )
  
      # we set the expected sequence length (which is used in several tests)
      # this is equal to the seq length of the text tokens + number of image patches + 1 for the CLS token
      self.expected_seq_len = (
          self.seq_length
          + (self.image_size // self.patch_size) ** 2
          + 1
      )
  
imports: import unittest
  from parameterized import parameterized
  from transformers import BitsAndBytesConfig, IdeficsConfig, is_torch_available, is_vision_available
  from transformers.testing_utils import TestCasePlus, require_bitsandbytes, require_torch, require_torch_sdpa, require_vision, slow, torch_device
  from transformers.utils import cached_property
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask
  from ...test_pipeline_mixin import PipelineTesterMixin
label_desc: Use image node_id 1 to create a new IdeficsModelTester object  with example: obj = IdeficsModelTester(parent, batch_size, seq_length, image_size, patch_size, num_channels, is_training, use_input_mask, use_token_type_ids, use_labels, vocab_size, hidden_size, num_hidden_layers, num_attention_heads, intermediate_size, hidden_act, hidden_dropout_prob, attention_probs_dropout_prob, max_position_embeddings, type_vocab_size, type_sequence_label_size, initializer_range, alpha_initializer, num_labels, scope, modality_type_vocab_size, vision_embed_dim, vision_patch_size, vision_image_size, vision_num_attention_heads, vision_num_hidden_layers, vision_intermediate_size, perceiver_qk_layer_norms_perceiver, perceiver_resampler_depth, perceiver_resampler_head_dim, perceiver_resampler_n_heads, perceiver_resampler_n_latents)