class_docstr: Adds adapters to the BertSelfAttention module.
class_docstr_tok: ["Adds","adapters","to","the","BertSelfAttention","module","."]
code: def init_adapters(self, model_config, adapters_config):
      # Wrap layers for LoRA
      self.query = LoRALinear.wrap(
          self.query,
          "selfattn",
          model_config,
          adapters_config,
          attn_key="q",
      )
      self.key = LoRALinear.wrap(
          self.key,
          "selfattn",
          model_config,
          adapters_config,
          attn_key="k",
      )
      self.value = LoRALinear.wrap(
          self.value,
          "selfattn",
          model_config,
          adapters_config,
          attn_key="v",
      )
  
      self.prefix_tuning = PrefixTuningLayer(
          self.location_key + "_prefix" if self.location_key else None,
          model_config,
          adapters_config,
      )
  
imports: import logging
  from typing import Iterable, Tuple
  import torch.nn
  from ...composition import adjust_tensors_for_parallel_
  from ...methods.bottleneck import BottleneckLayer
  from ...methods.lora import LoRALinear
  from ...methods.prefix_tuning import PrefixTuningLayer
  from ...model_mixin import EmbeddingAdaptersMixin, InvertibleAdaptersMixin, ModelBaseAdaptersMixin
label_desc: Use image node_id 1 for calling the BertSelfAttentionAdaptersMixin obj's underlying member method code with example usage: obj.init_adapters(model_config, adapters_config) without return types