class_docstr: This class manages the setup and configuration of adapter modules in a pre-trained model.
class_docstr_tok: ["This","class","manages","the","setup","and","configuration","of","adapter","modules","in","a","pre-trained","model","."]
docstr: Adds a new AdapterFusion.
  
  Args:
      fusion_name (Union[str, List[str]]): The name of the AdapterFusion or the adapters to fuse.
      config (Optional[Union[str, dict]], optional): AdapterFusion config. Defaults to None.
docstr_tok: ["Adds","a","new","AdapterFusion",".","Args",":","fusion_name","(","Union","[","str",",","List","[","str","]","]",")",":","The","name","of","the","AdapterFusion","or","the","adapters","to","fuse",".","config","(","Optional","[","Union","[","str",",","dict","]","]",",","optional",")",":","AdapterFusion","config",".","Defaults","to","None","."]
code: def add_fusion(
      self,
      fusion_name: Union[str, List[str]],
      config: Optional[Union[str, dict]] = None,
  ):
      """
      Adds a new AdapterFusion.
  
      Args:
          fusion_name (Union[str, List[str]]): The name of the AdapterFusion or the adapters to fuse.
          config (Optional[Union[str, dict]], optional): AdapterFusion config. Defaults to None.
      """
      if isinstance(fusion_name, list):
          fusion_name = ",".join(fusion_name)
      if fusion_name in self.fusions:
          raise ValueError(
              f"An AdapterFusion with the name '{fusion_name}' has already been added."
          )
      if config is None:
          config = DEFAULT_ADAPTERFUSION_CONFIG
      if isinstance(config, str):
          if (
              config not in ADAPTERFUSION_CONFIG_MAP
              and config not in self.fusion_config_map
          ):
              raise ValueError(
                  f"Invalid AdapterFusion config identifier '{config}'."
              )
          config_name = config
      # if it's a dict, compute it's hash and add a new entry to the config map
      elif isinstance(config, Mapping):
          config_name = get_adapter_config_hash(config)
          self.fusion_config_map[config_name] = config
      else:
          raise ValueError(
              "Invalid AdapterFusion config: {}".format(config)
          )
      self.fusions[fusion_name] = config_name
      logger.info(f"Adding AdapterFusion '{fusion_name}'.")
  
imports: import copy
  import logging
  from collections.abc import Collection, Mapping
  from typing import List, Optional, Union
  from ..None import __version__
  from ..composition import AdapterCompositionBlock
  from ..utils import get_adapter_config_hash
  from .adapter_config import ADAPTER_CONFIG_MAP, DEFAULT_ADAPTER_CONFIG, AdapterConfig, ConfigUnion
  from .adapter_fusion_config import ADAPTERFUSION_CONFIG_MAP, DEFAULT_ADAPTERFUSION_CONFIG
label_desc: Use image node_id 9 for calling the ModelAdaptersConfig obj's underlying member method code with example usage: obj.add_fusion(fusion_name, config) without return types