class_docstr: Base class for all adapter methods that support composition.
  
  Make sure the 'adapter_modules_name' and 'supported_compositions' attributes as well as all abstract methods are
  overriden in derived classes. 'allow_multi_parallelize' can be set to True to allow inputs to be parallelized
  independently multiple times. This is useful when there are multiple parallel input flows through an adapter layer
  (e.g. in LoRA).
class_docstr_tok: ["Base","class","for","all","adapter","methods","that","support","composition",".","Make","sure","the","'adapter_modules_name","'","and","'supported_compositions","'","attributes","as","well","as","all","abstract","methods","are","overriden","in","derived","classes",".","'allow_multi_parallelize","'","can","be","set","to","True","to","allow","inputs","to","be","parallelized","independently","multiple","times",".","This","is","useful","when","there","are","multiple","parallel","input","flows","through","an","adapter","layer","(","e.g",".","in","LoRA",")","."]
docstr: For sequentially stacking multiple adapters.
docstr_tok: ["For","sequentially","stacking","multiple","adapters","."]
code: def compose_stack(
      self, adapter_setup: Stack, state: NamedTuple, lvl: int = 0
  ) -> NamedTuple:
      """
      For sequentially stacking multiple adapters.
      """
      for i, adapter_stack_layer in enumerate(adapter_setup):
          if isinstance(adapter_stack_layer, AdapterCompositionBlock):
              self.check_composition_valid(
                  adapter_setup, adapter_stack_layer, lvl
              )
              composition_func = self.composition_to_func_map[
                  type(adapter_stack_layer)
              ]
              state = composition_func(
                  adapter_stack_layer, state, lvl=lvl + 1
              )
          elif adapter_stack_layer in self.adapter_modules:
              state = self.pre_block(adapter_stack_layer, state)
              state = self.compose_single(
                  adapter_stack_layer, state, lvl=lvl + 1
              )
          else:
              raise ValueError(
                  "Invalid adapter setup: {} is not a valid adapter name or composition block.".format(
                      adapter_stack_layer.__class__.__name__
                  )
              )
  
      return state
  
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 11 for calling the ComposableAdapterLayerBase obj's underlying member method code with example usage: obj.compose_stack(adapter_setup, state, lvl) and returns: state