code: def test_cross_attention_gates(self):
      (
          config,
          inputs_w_same_img,
          inputs_w_0_img_attn,
      ) = self.model_tester.prepare_config_and_inputs_gate_tests()
  
      model = IdeficsModel(config=config).to(torch_device)
      model.eval()
      test_1_results = []
      for inputs in inputs_w_same_img:
          with torch.no_grad():
              last_hidden_states = model(**inputs).last_hidden_state
          last_hidden_states = model(**inputs).last_hidden_state
          test_1_results.append(last_hidden_states)
      self.assertNotEqual(
          test_1_results[0].sum().item(), test_1_results[1].sum().item()
      )
  
      test_2_results = []
      for inputs in inputs_w_0_img_attn:
          with torch.no_grad():
              last_hidden_states = model(**inputs).last_hidden_state
          test_2_results.append(last_hidden_states)
      self.assertEqual(
          test_2_results[0].sum().item(), test_2_results[1].sum().item()
      )
  
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 11 for calling the IdeficsModelTest obj's underlying member method code with example usage: obj.test_cross_attention_gates() without return types