code: def test_add_custom_head(self):
      model_name = "bert-base-uncased"
      model = AutoAdapterModel.from_pretrained(model_name)
      model.register_custom_head("tag", CustomHead)
      config = {
          "num_labels": 3,
          "layers": 2,
          "activation_function": "tanh",
      }
      model.add_custom_head(
          head_type="tag", head_name="custom_head", **config
      )
      model.eval()
      model.to(torch_device)
      in_data = ids_tensor((1, 128), 1000)
      output1 = model(in_data)
      model.add_tagging_head("tagging_head", num_labels=3, layers=2)
      model.to(torch_device)
      output2 = model(in_data)
      self.assertEqual(output1[0].size(), output2[0].size())
  
file_path: adapters/tests/test_adapter_custom_head.py
imports: import tempfile
  import unittest
  import torch
  from adapters import AutoAdapterModel
  from adapters.heads import ClassificationHead, PredictionHead
  from transformers import AutoConfig
  from transformers.testing_utils import require_torch, torch_device
  from .test_adapter import ids_tensor
label_desc: Use image node_id 1 for calling the AdapterCustomHeadTest obj's underlying member method code with example usage: obj.test_add_custom_head() without return types