code: def test_output_adapter_fusion_attentions(self):
      model = self.get_model()
      model.eval()
  
      model.add_adapter("a")
      model.add_adapter("b")
      model.add_adapter_fusion(["a", "b"])
      model.to(torch_device)
  
      input_data = self.get_input_samples(config=model.config)
  
      model.set_active_adapters(Fuse("a", "b"))
      output_1 = model(
          **input_data, output_adapter_fusion_attentions=True
      )
  
      self.assertEqual(
          len(output_1[0]), self.default_input_samples_shape[0]
      )
      self.assertTrue(hasattr(output_1, "adapter_fusion_attentions"))
      attention_scores = output_1.adapter_fusion_attentions["a,b"]
      self.assertEqual(
          len(list(model.iter_layers())), len(attention_scores)
      )
      for k, per_layer_scores in attention_scores.items():
          self.assertEqual(len(per_layer_scores), 1)
          for k, v in per_layer_scores.items():
              self.assertEqual(
                  self.default_input_samples_shape[0], v.shape[0], k
              )
  
file_path: adapters/tests/test_adapter_fusion_common.py
imports: import copy
  import os
  import tempfile
  from dataclasses import asdict
  import torch
  from adapters import ADAPTER_MODEL_MAPPING, ADAPTERFUSION_CONFIG_MAP, AdapterConfig, AutoAdapterModel, SeqBnConfig
  from adapters.composition import Fuse
  from adapters.utils import ADAPTERFUSION_WEIGHTS_NAME
  from adapters.wrappers import load_model
  from transformers.testing_utils import require_torch, torch_device
label_desc: Use image node_id 8 for calling the AdapterFusionModelTestMixin obj's underlying member method code with example usage: obj.test_output_adapter_fusion_attentions() without return types