class_docstr: Representation of a Prefix Tuning layer within one Transformer layer. This class implements `AdapterLayerBase` for
  compatibility with adapters. It uses `PrefixTuningPool` in the background and `set_pool()` must be called after
  initialization.
  
  Args:
      location_key (str): The id describing the location of this layer in the model.
                          Currently, can be "encoder_prefix", "cross_prefix" or None.
      config (:class:`~transformers.PretrainedConfig`): The model config.
class_docstr_tok: ["Representation","of","a","Prefix","Tuning","layer","within","one","Transformer","layer",".","This","class","implements","`","AdapterLayerBase","`","for","compatibility","with","adapters",".","It","uses","`","PrefixTuningPool","`","in","the","background","and","`","set_pool","(",")","`","must","be","called","after","initialization",".","Args",":","location_key","(","str",")",":","The","id","describing","the","location","of","this","layer","in","the","model",".","Currently",",","can","be","``","encoder_prefix","''",",","``","cross_prefix","''","or","None",".","config","(",":","class",":","`","~transformers.PretrainedConfig","`",")",":","The","model","config","."]
code: def add_adapter(self, adapter_name: str, layer_idx: int) -> bool:
      self.layer_idx = layer_idx
      # only match location keys for which we have config keys
      if self.location_key.startswith(
          "cross"
      ) or self.location_key.startswith("encoder"):
          used_location_key = self.location_key
      else:
          used_location_key = None
      prefix_tuning_config = self.adapters_config.match(
          adapter_name,
          config_type=PrefixTuningConfig,
          layer_idx=self.layer_idx,
          location_key=used_location_key,
      )
      if prefix_tuning_config is not None:
          prefix_id = self.pool.indicate_prefix(
              adapter_name,
              self.location_key,
              n_heads=self.model_config.num_attention_heads,
              input_size=self.model_config.hidden_size,
              n_embd_per_head=getattr(
                  self.model_config, "d_kv", None
              ),  # this is currently specific to T5-3B
          )
          self.prefixes[adapter_name] = prefix_id
  
          if prefix_tuning_config.use_gating:
              gate_outputs = (
                  1 if prefix_tuning_config.shared_gating else 2
              )
              gate = nn.Linear(
                  self.model_config.hidden_size, gate_outputs
              )
              gate.weight.data.normal_(mean=0.0, std=0.02)
              self.prefix_gates[adapter_name] = gate
          return True
  
      return False
  
imports: from typing import Dict, List, NamedTuple, Optional, Union
  import torch
  import torch.nn.functional
  from torch import nn
  from transformers import PretrainedConfig
  from transformers.modeling_utils import ModuleUtilsMixin
  from ..composition import AdapterCompositionBlock, BatchSplit, Parallel, Stack, adjust_tensors_for_parallel
  from ..configuration import ModelAdaptersConfig, PrefixTuningConfig
  from ..context import AdapterSetup, ForwardContext
  from .adapter_layer_base import ComposableAdapterLayerBase
  from .modeling import Activation_Function_Class
label_desc: Use image node_id 3 for calling the PrefixTuningLayer obj's underlying member method code with example usage: obj.add_adapter(adapter_name, layer_idx) and returns: False, True