docstr: Converts all PrefixTuning modules into FlatPrefixTuning modules.
docstr_tok: ["Converts","all","PrefixTuning","modules","into","FlatPrefixTuning","modules","."]
code: def eject(self):
      """Converts all PrefixTuning modules into FlatPrefixTuning modules."""
      for k, v in self.items():
          if isinstance(v, PrefixTuning):
              config = v.config.replace(flat=True)
              self[k] = FlatPrefixTuning(
                  v.n_layers, v.n_heads, v.input_size, config
              )
              weights = v.eject()
              self[k].control_trans = nn.Parameter(weights)
  
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 2 for calling the PrefixTuningGroup obj's underlying member method code with example usage: obj.eject() without return types