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_forward_test(self, model, adapter_config):
      model.eval()
  
      name = adapter_config.__class__.__name__
      model.add_adapter(name, config=adapter_config)
      model.to(torch_device)
  
      input_data = self.get_input_samples(config=model.config)
  
      # pass 1: set adapter via property
      model.set_active_adapters([name])
      output_1 = model(**input_data)
  
      # pass 2: set via context
      # unset and make sure it's unset
      model.set_active_adapters(None)
      self.assertEqual(None, model.active_adapters)
      with AdapterSetup(name):
          output_2 = model(**input_data)
  
      # pass 3: base output
      model.set_active_adapters(None)
      base_output = model(**input_data)
  
      self.assertEqual(len(output_1), len(output_2))
      self.assertTrue(torch.equal(output_1[0], output_2[0]))
      self.assertGreaterEqual(len(output_1), len(base_output))
      self.assertFalse(torch.equal(output_1[0], base_output[0]))
  
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 7 for calling the AdapterMethodBaseTestMixin obj's underlying member method code with example usage: obj.run_forward_test(model, adapter_config) without return types