code: def __init__(
      self,
      parent,
      batch_size=13,
      seq_length=7,
      num_channels=3,
      image_size=32,
      train_size=[20, 20],
      num_frames=5,
      audio_samples_per_frame=200,
      samples_per_patch=20,
      nchunks=20,
      num_latents=10,
      d_latents=20,
      num_blocks=1,
      num_self_attends_per_block=2,
      num_self_attention_heads=1,
      num_cross_attention_heads=1,
      self_attention_widening_factor=4,
      cross_attention_widening_factor=4,
      is_training=True,
      use_input_mask=True,
      use_labels=True,
      vocab_size=99,
      hidden_act="gelu",
      attention_probs_dropout_prob=0.1,
      initializer_range=0.02,
      max_position_embeddings=7,
      num_labels=3,
      scope=None,
  ):
      self.parent = parent
      self.batch_size = batch_size
      self.seq_length = seq_length
      self.num_channels = num_channels
      self.image_size = image_size
      self.train_size = train_size
      self.num_frames = num_frames
      self.audio_samples_per_frame = audio_samples_per_frame
      self.samples_per_patch = samples_per_patch
      self.nchunks = nchunks
      self.num_latents = num_latents
      self.d_latents = d_latents
      self.num_blocks = num_blocks
      self.num_self_attends_per_block = num_self_attends_per_block
      self.num_self_attention_heads = num_self_attention_heads
      self.num_cross_attention_heads = num_cross_attention_heads
      self.self_attention_widening_factor = (
          self_attention_widening_factor
      )
      self.cross_attention_widening_factor = (
          cross_attention_widening_factor
      )
      self.is_training = is_training
      self.use_input_mask = use_input_mask
      self.use_labels = use_labels
      self.vocab_size = vocab_size
      self.hidden_act = hidden_act
      self.attention_probs_dropout_prob = attention_probs_dropout_prob
      self.max_position_embeddings = max_position_embeddings
      self.initializer_range = initializer_range
      self.num_labels = num_labels
      self.scope = scope
      # set subsampling for multimodal model (take first chunk)
      image_chunk_size = (
          np.prod((self.num_frames, self.image_size, self.image_size))
          // self.nchunks
      )
      audio_chunk_size = (
          self.num_frames
          * self.audio_samples_per_frame
          // self.samples_per_patch
          // self.nchunks
      )
      self.subsampling = {
          "image": torch.arange(0, image_chunk_size),
          "audio": torch.arange(0, audio_chunk_size),
          "label": None,
      }
  
imports: import copy
  import inspect
  import math
  import tempfile
  import unittest
  import warnings
  from typing import Dict, List, Tuple
  import numpy
  from datasets import load_dataset
  from transformers import PerceiverConfig
  from transformers.models.auto import get_values
  from transformers.testing_utils import require_torch, require_torch_multi_gpu, require_vision, slow, torch_device
  from transformers.utils import is_torch_available, is_vision_available
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask
label_desc: Use image node_id 1 to create a new PerceiverModelTester object  with example: obj = PerceiverModelTester(parent, batch_size, seq_length, num_channels, image_size, train_size, num_frames, audio_samples_per_frame, samples_per_patch, nchunks, num_latents, d_latents, num_blocks, num__attends_per_block, num__attention_heads, num_cross_attention_heads, _attention_widening_factor, cross_attention_widening_factor, is_training, use_input_mask, use_labels, vocab_size, hidden_act, attention_probs_dropout_prob, initializer_range, max_position_embeddings, num_labels, scope)