code: def test_batch_split_training(self):
      if not self.do_run_train_tests:
          self.skipTest(
              "Skipping training tests. Set `do_run_train_tests=True` to run them."
          )
      if self.config_class not in ADAPTER_MODEL_MAPPING:
          self.skipTest("Does not support flex heads.")
      model = AutoAdapterModel.from_config(self.config())
  
      model.add_adapter("mrpc1")
      model.add_adapter("mrpc2")
      self.add_head(model, "mrpc1")
      self.add_head(model, "mrpc2")
      adapter_setup = BatchSplit("mrpc1", "mrpc2", batch_sizes=[1, 1])
      model.active_adapters = adapter_setup
      model.train_adapter(adapter_setup)
  
      # all weights of the adapter should be activated
      for k, v in self.filter_parameters(
          model, ["adapters.mrpc1."]
      ).items():
          self.assertTrue(v.requires_grad, k)
      # all weights of the adapter not used for training should be frozen
      for k, v in self.filter_parameters(
          model, ["adapters.mrpc2."]
      ).items():
          self.assertTrue(v.requires_grad, k)
      # weights of the model should be frozen (check on some examples)
      for k, v in self.filter_parameters(
          model, ["encoder.layer.0.attention"]
      ).items():
          self.assertFalse(v.requires_grad, k)
  
      state_dict_pre = copy.deepcopy(model.state_dict())
  
      self.trainings_run(model)
  
      # check that the adapters have changed, but the base model has not
      adapters_with_change, base_with_change = False, False
      for (k1, v1), (k2, v2) in zip(
          state_dict_pre.items(), model.state_dict().items()
      ):
          if "mrpc" in k1:
              adapters_with_change |= not torch.equal(v1, v2)
          else:
              base_with_change |= not torch.equal(v1, v2)
      self.assertTrue(adapters_with_change)
      self.assertFalse(base_with_change)
  
imports: import copy
  import tempfile
  import torch
  import adapters
  from adapters import ADAPTER_CONFIG_MAP, ADAPTER_MODEL_MAPPING, AutoAdapterModel, BatchSplit, DoubleSeqBnConfig, DoubleSeqBnInvConfig, Fuse, InvertibleAdaptersMixin, InvertibleAdaptersWrapperMixin, MAMConfig, SeqBnConfig, SeqBnInvConfig
  from adapters.heads.language_modeling import CausalLMHead
  from transformers import MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING, CLIPConfig
  from transformers.testing_utils import require_torch, torch_device
  from .base import AdapterMethodBaseTestMixin, create_twin_models
label_desc: Use image node_id 23 for calling the BottleneckAdapterTestMixin obj's underlying member method code with example usage: obj.test_batch_split_training() without return types