class_docstr: Base class for all adaptation methods that require per-layer modules.
  
  Make sure the 'adapter_modules_name' attribute is overriden in derived classes.
class_docstr_tok: ["Base","class","for","all","adaptation","methods","that","require","per-layer","modules",".","Make","sure","the","'adapter_modules_name","'","attribute","is","overriden","in","derived","classes","."]
code: def _store_fusion_attentions(self, fusion_name, attentions):
      context = ForwardContext.get_context()
      if context.output_adapter_fusion_attentions:
          attention_cache = context.adapter_fusion_attentions
          if self.layer_idx not in attention_cache[fusion_name]:
              attention_cache[fusion_name][self.layer_idx] = {}
          attention_cache[fusion_name][self.layer_idx][
              self.location_key
          ] = attentions
  
imports: from abc import ABCMeta, abstractmethod
  from typing import Collection, Dict, List, NamedTuple, Union
  import numpy
  import torch
  from torch import nn
  from ..composition import ALLOWED_NESTINGS, AdapterCompositionBlock, Average, BatchSplit, Fuse, Parallel, Split, Stack
  from ..context import AdapterSetup, ForwardContext
label_desc: Use image node_id 6 for calling the AdapterLayerBase obj's underlying member method code with example usage: obj._store_fusion_attentions(fusion_name, attentions) without return types