class_docstr: Provides base test running methods for testing an adapter method implementation.
class_docstr_tok: ["Provides","base","test","running","methods","for","testing","an","adapter","method","implementation","."]
code: def run_merge_test(self, adapter_config):
      model = self.get_model()
      model.eval()
      model.add_adapter("test_lora", config=adapter_config)
      model.to(torch_device)
  
      input_data = self.get_input_samples(config=model.config)
  
      # forward in training mode
      model.set_active_adapters(["test_lora"])
      output_1 = model(**input_data)
  
      # forward in merged mode
      model.set_active_adapters(None)
      model.merge_adapter("test_lora")
      model.to(torch_device)
      model.eval()
      output_2 = model(**input_data)
  
      # check forward pass
      self.assertEqual(len(output_1), len(output_2))
      self.assertTrue(
          torch.allclose(output_1[0], output_2[0], atol=1e-3)
      )
  
imports: import copy
  import os
  import tempfile
  import torch
  import adapters
  from adapters import ADAPTER_MODEL_MAPPING, AdapterSetup, AdapterTrainer, AutoAdapterModel
  from adapters.heads import CausalLMHead
  from adapters.utils import WEIGHTS_NAME
  from adapters.wrappers import load_model
  from transformers import TrainingArguments
  from transformers.testing_utils import require_torch, torch_device
label_desc: Use image node_id 12 for calling the AdapterMethodBaseTestMixin obj's underlying member method code with example usage: obj.run_merge_test(adapter_config) without return types