docstr: Unfreezes a given list of adapters, the adapter fusion layer, or both
  
  Args:
      adapter_names: names of adapters to unfreeze (or names of adapters part of the fusion layer to unfreeze)
      unfreeze_adapters: whether the adapter weights should be activated
      unfreeze_fusion: whether the adapter fusion layer for the given adapters should be activated
docstr_tok: ["Unfreezes","a","given","list","of","adapters",",","the","adapter","fusion","layer",",","or","both","Args",":","adapter_names",":","names","of","adapters","to","unfreeze","(","or","names","of","adapters","part","of","the","fusion","layer","to","unfreeze",")","unfreeze_adapters",":","whether","the","adapter","weights","should","be","activated","unfreeze_fusion",":","whether","the","adapter","fusion","layer","for","the","given","adapters","should","be","activated"]
code: def enable_adapters(
      self,
      adapter_setup: AdapterCompositionBlock,
      unfreeze_adapters: bool,
      unfreeze_fusion: bool,
  ):
      """
      Unfreezes a given list of adapters, the adapter fusion layer, or both
  
      Args:
          adapter_names: names of adapters to unfreeze (or names of adapters part of the fusion layer to unfreeze)
          unfreeze_adapters: whether the adapter weights should be activated
          unfreeze_fusion: whether the adapter fusion layer for the given adapters should be activated
      """
      if unfreeze_adapters:
          for adapter_name in adapter_setup.flatten():
              if adapter_name in self.adapters:
                  for param in self.adapters[adapter_name].parameters():
                      param.requires_grad = True
      if unfreeze_fusion:
          if isinstance(adapter_setup, Fuse):
              if adapter_setup.name in self.adapter_fusion_layer:
                  for param in self.adapter_fusion_layer[
                      adapter_setup.name
                  ].parameters():
                      param.requires_grad = True
          for sub_setup in adapter_setup:
              if isinstance(sub_setup, Fuse):
                  if sub_setup.name in self.adapter_fusion_layer:
                      for param in self.adapter_fusion_layer[
                          sub_setup.name
                      ].parameters():
                          param.requires_grad = True
  
imports: from typing import Dict, List, Mapping, NamedTuple, Optional, Union
  import torch
  from torch import nn
  from ..composition import AdapterCompositionBlock, Average, BatchSplit, Fuse, Parallel, Split, Stack, adjust_tensors_for_parallel
  from ..configuration import BnConfig
  from ..context import ForwardContext
  from .adapter_layer_base import ComposableAdapterLayerBase
  from .modeling import Adapter, BertFusion, ParallelAdapter
label_desc: Use image node_id 8 for calling the BottleneckLayer obj's underlying member method code with example usage: obj.enable_adapters(adapter_setup, unfreeze_adapters, unfreeze_fusion) without return types