code: def test_inference_question_answering_head_strong_supervision(self):
      # note that google/tapas-base-finetuned-wikisql-supervised should correspond to tapas_wikisql_sqa_inter_masklm_base_reset
      model = TapasForQuestionAnswering.from_pretrained(
          "google/tapas-base-finetuned-wikisql-supervised"
      ).to(torch_device)
  
      tokenizer = self.default_tokenizer
      table, queries = prepare_tapas_single_inputs_for_inference()
      inputs = tokenizer(
          table=table, queries=queries, return_tensors="pt"
      )
      inputs = {k: v.to(torch_device) for k, v in inputs.items()}
      with torch.no_grad():
          outputs = model(**inputs)
      # test the logits
      logits = outputs.logits
      expected_shape = torch.Size((1, 21))
      self.assertEqual(logits.shape, expected_shape)
      expected_tensor = torch.tensor(
          [
              [
                  -10011.1084,
                  -10011.1084,
                  -10011.1084,
                  -10011.1084,
                  -10011.1084,
                  -10011.1084,
                  -10011.1084,
                  -10011.1084,
                  -10011.1084,
                  -18.6185989,
                  -10008.7969,
                  17.6355762,
                  17.6355762,
                  17.6355762,
                  -10002.4404,
                  -18.7111301,
                  -18.7111301,
                  -18.7111301,
                  -18.7111301,
                  -18.7111301,
                  -10007.0977,
              ]
          ],
          device=torch_device,
      )
  
      self.assertTrue(
          torch.allclose(logits, expected_tensor, atol=0.02)
      )
  
      # test the aggregation logits
      logits_aggregation = outputs.logits_aggregation
      expected_shape = torch.Size((1, 4))
      self.assertEqual(logits_aggregation.shape, expected_shape)
      expected_tensor = torch.tensor(
          [[16.5659733, -3.06624889, -2.34152961, -0.970244825]],
          device=torch_device,
      )  # PyTorch model outputs [[16.5679, -3.0668, -2.3442, -0.9674]]
  
      self.assertTrue(
          torch.allclose(
              logits_aggregation, expected_tensor, atol=0.003
          )
      )
  
imports: import copy
  import unittest
  import numpy
  import pandas
  from transformers import MODEL_FOR_CAUSAL_LM_MAPPING, MODEL_FOR_MASKED_LM_MAPPING, MODEL_FOR_MULTIPLE_CHOICE_MAPPING, MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING, MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING, MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING, MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING, MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING, TapasConfig, is_torch_available
  from transformers.models.auto import get_values
  from transformers.testing_utils import require_scatter, require_tensorflow_probability, require_torch, slow, torch_device
  from transformers.utils import cached_property
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask
label_desc: Use image node_id 8 for calling the TapasModelIntegrationTest obj's underlying member method code with example usage: obj.test_inference_question_answering_head_strong_supervision() without return types