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: The main composition forward method which recursively calls the composition blocks forward methods.
  This method should be called by the forward method of the derived class.
  
  Args:
      adapter_setup (Union[AdapterCompositionBlock, str]): The adapter setup to be used.
      state (NamedTuple): The current state.
  
  Returns:
      NamedTuple: The state after forwarding through the adapter setup.
docstr_tok: ["The","main","composition","forward","method","which","recursively","calls","the","composition","blocks","forward","methods",".","This","method","should","be","called","by","the","forward","method","of","the","derived","class",".","Args",":","adapter_setup","(","Union","[","AdapterCompositionBlock",",","str","]",")",":","The","adapter","setup","to","be","used",".","state","(","NamedTuple",")",":","The","current","state",".","Returns",":","NamedTuple",":","The","state","after","forwarding","through","the","adapter","setup","."]
code: def compose(
      self,
      adapter_setup: Union[AdapterCompositionBlock, str],
      state: NamedTuple,
  ) -> NamedTuple:
      """The main composition forward method which recursively calls the composition blocks forward methods.
      This method should be called by the forward method of the derived class.
  
      Args:
          adapter_setup (Union[AdapterCompositionBlock, str]): The adapter setup to be used.
          state (NamedTuple): The current state.
  
      Returns:
          NamedTuple: The state after forwarding through the adapter setup.
      """
      if isinstance(adapter_setup, AdapterCompositionBlock):
          composition_func = self.composition_to_func_map[
              type(adapter_setup)
          ]
          state = composition_func(adapter_setup, state, lvl=0)
      elif adapter_setup in self.adapter_modules:
          state = self.compose_single(adapter_setup, state, lvl=0)
      else:
          raise ValueError(
              "Invalid adapter setup: {} is not a valid adapter name or composition block.".format(
                  adapter_setup.__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 17 for calling the ComposableAdapterLayerBase obj's underlying member method code with example usage: obj.compose(adapter_setup, state) and returns: state