code: def test_parallel_inference_with_heads(self):
      model = AutoAdapterModel.from_config(self.config())
  
      model.add_adapter("a")
      model.add_adapter("b")
      self.add_head(model, "a", num_labels=2)
      self.add_head(model, "b", num_labels=3)
      model.eval()
      model.to(torch_device)
  
      inputs = self.get_input_samples(config=model.config)
      inputs["attention_mask"] = torch.randint(
          0, 2, size=(3, 64), device=torch_device
      )
  
      # for reference, pass through single adapters
      model.active_adapters = "a"
      model.active_head = "a"
      outputs_a = model(**inputs)
      model.active_adapters = "b"
      model.active_head = "b"
      outputs_b = model(**inputs)
  
      model.active_adapters = Parallel("a", "b")
      # active_adapters should set parallel heads too
      self.assertEqual(model.active_head, ["a", "b"])
      outputs = model(**inputs)
  
      self.assertEqual(len(outputs), 2)
      if self.config_class in MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING:
          self.assertEqual(outputs[0][0].shape, (3, 2))
          self.assertEqual(outputs[1][0].shape, (3, 3))
      self.assertTrue(
          torch.allclose(outputs[0][0], outputs_a[0], atol=1e-5)
      )
      self.assertTrue(
          torch.allclose(outputs[1][0], outputs_b[0], atol=1e-5)
      )
  
imports: import copy
  import random
  import torch
  from adapters import ADAPTER_MODEL_MAPPING, AutoAdapterModel, PrefixTuningConfig, SeqBnConfig, T5AdapterModel
  from adapters.composition import BatchSplit, Parallel
  from adapters.models.bert_generation.adapter_model import BertGenerationAdapterModel
  from transformers import MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING, Trainer, TrainingArguments
  from transformers.testing_utils import require_torch, torch_device
label_desc: Use image node_id 1 for calling the ParallelAdapterInferenceTestMixin obj's underlying member method code with example usage: obj.test_parallel_inference_with_heads() without return types