code: def test_load_adapter_fusion(self):
      for (
          adater_fusion_config_name,
          adapter_fusion_config,
      ) in ADAPTERFUSION_CONFIG_MAP.items():
          model1 = self.get_model()
          model1.eval()
  
          with self.subTest(model_class=model1.__class__.__name__):
              name1 = "name1"
              name2 = "name2"
              model1.add_adapter(name1)
              model1.add_adapter(name2)
  
              model2 = copy.deepcopy(model1)
              model2.eval()
  
              model1.add_adapter_fusion(
                  [name1, name2], adater_fusion_config_name
              )
              model1.set_active_adapters([[name1, name2]])
  
              with tempfile.TemporaryDirectory() as temp_dir:
                  model1.save_adapter_fusion(
                      temp_dir, ",".join([name1, name2])
                  )
                  # also tests that set_active works
                  model2.load_adapter_fusion(temp_dir, set_active=True)
              # In another directory, also check that saving via passing a Fuse block works
              with tempfile.TemporaryDirectory() as temp_dir:
                  model1.save_adapter_fusion(
                      temp_dir, Fuse(name1, name2)
                  )
                  self.assertTrue(
                      os.path.exists(
                          os.path.join(
                              temp_dir, ADAPTERFUSION_WEIGHTS_NAME
                          )
                      )
                  )
  
              # check if adapter was correctly loaded
              self.assertEqual(
                  model1.adapters_config.fusions.keys(),
                  model2.adapters_config.fusions.keys(),
              )
  
              # check equal output
              in_data = self.get_input_samples(config=model1.config)
              model1.to(torch_device)
              model2.to(torch_device)
              output1 = model1(**in_data)
              output2 = model2(**in_data)
              self.assertEqual(len(output1), len(output2))
              self.assertTrue(torch.equal(output1[0], output2[0]))
  
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 4 for calling the AdapterFusionModelTestMixin obj's underlying member method code with example usage: obj.test_load_adapter_fusion() without return types