docstr: Splits the given input between the given adapters.
docstr_tok: ["Splits","the","given","input","between","the","given","adapters","."]
code: def compose_split(
      self, adapter_setup: Split, state: BottleneckState, lvl: int = 0
  ):
      """
      Splits the given input between the given adapters.
      """
      if sum(adapter_setup.splits) != state.hidden_states.shape[1]:
          raise IndexError(
              "The given input has sequence length {} which is not equal to the sum of splits {}".format(
                  state.hidden_states.shape[1], adapter_setup.splits
              )
          )
  
      state = self.pre_block(adapter_setup, state)
  
      children_states = []
      for i, child in enumerate(adapter_setup):
          batch_idx = (
              sum(adapter_setup.splits[:i]),
              sum(adapter_setup.splits[: i + 1]),
          )
          child_state = BottleneckState(
              state.hidden_states[:, batch_idx[0] : batch_idx[1], :],
              state.input_tensor[:, batch_idx[0] : batch_idx[1], :],
              state.adapter_residual[:, batch_idx[0] : batch_idx[1], :],
              state.layer_norm,
              state.bottleneck_up[:, batch_idx[0] : batch_idx[1], :]
              if state.bottleneck_up is not None
              else None,
          )
          if isinstance(child, AdapterCompositionBlock):
              self.check_composition_valid(adapter_setup, child, lvl)
              composition_func = self.composition_to_func_map[
                  type(child)
              ]
              child_state = composition_func(
                  child, child_state, lvl=lvl + 1
              )
              children_states.append(child_state)
          elif child in self.adapter_modules:
              child_state = self.compose_single(
                  child, child_state, lvl=lvl + 1
              )
              children_states.append(child_state)
          else:
              pass
  
      hidden_states = torch.cat(
          [child.hidden_states for child in children_states], dim=1
      )
      return state._replace(hidden_states=hidden_states)
  
imports: from typing import Dict, List, Mapping, NamedTuple, Optional, Union
  import torch
  from torch import nn
  from ..composition import AdapterCompositionBlock, Average, BatchSplit, Fuse, Parallel, Split, Stack, adjust_tensors_for_parallel
  from ..configuration import BnConfig
  from ..context import ForwardContext
  from .adapter_layer_base import ComposableAdapterLayerBase
  from .modeling import Adapter, BertFusion, ParallelAdapter
label_desc: Use image node_id 18 for calling the BottleneckLayer obj's underlying member method code with example usage: obj.compose_split(adapter_setup, state, lvl) and returns: state