class_docstr: Adds adapters to the BertLayer module.
class_docstr_tok: ["Adds","adapters","to","the","BertLayer","module","."]
code: def init_adapters(self, model_config, adapters_config):
      # Wrap layers for LoRA
      self.intermediate.dense = LoRALinear.wrap(
          self.intermediate.dense,
          "intermediate",
          model_config,
          adapters_config,
      )
      self.output.dense = LoRALinear.wrap(
          self.output.dense, "output", model_config, adapters_config
      )
  
      # Set location keys for prefix tuning
      self.attention.self.location_key = "self"
      if (
          hasattr(self, "add_cross_attention")
          and self.add_cross_attention
      ):
          self.crossattention.self.location_key = "cross"
  
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 BertLayerAdaptersMixin obj's underlying member method code with example usage: obj.init_adapters(model_config, adapters_config) without return types