code: def resize_lxmert_num_qa_labels(
      self,
      config,
      input_ids,
      visual_feats,
      bounding_boxes,
      token_type_ids,
      input_mask,
      obj_labels,
      masked_lm_labels,
      matched_label,
      ans,
      output_attentions,
  ):
      start_labels = config.num_qa_labels
      num_large_labels = config.num_qa_labels * 2
      num_small_labels = int(config.num_qa_labels * 2)
      less_labels_ans = ids_tensor([self.batch_size], num_small_labels)
      more_labels_ans = ids_tensor([self.batch_size], num_large_labels)
      model_pretrain = LxmertForPreTraining(config=config).to(
          torch_device
      )
      model_qa = LxmertForQuestionAnswering(config=config).to(
          torch_device
      )
      config.num_labels = num_small_labels
      end_labels = config.num_labels
  
      result_pretrain = model_pretrain(
          input_ids,
          visual_feats,
          bounding_boxes,
          token_type_ids=token_type_ids,
          attention_mask=input_mask,
          ans=ans,
      )
  
      result_qa = model_qa(
          input_ids,
          visual_feats,
          bounding_boxes,
          labels=ans,
          token_type_ids=token_type_ids,
          attention_mask=input_mask,
      )
  
      model_pretrain.resize_num_qa_labels(num_small_labels)
      model_qa.resize_num_qa_labels(num_small_labels)
  
      result_pretrain_less = model_pretrain(
          input_ids,
          visual_feats,
          bounding_boxes,
          token_type_ids=token_type_ids,
          attention_mask=input_mask,
          ans=less_labels_ans,
      )
  
      result_qa_less = model_qa(
          input_ids,
          visual_feats,
          bounding_boxes,
          labels=less_labels_ans,
          token_type_ids=token_type_ids,
          attention_mask=input_mask,
      )
  
      model_pretrain.resize_num_qa_labels(num_large_labels)
      model_qa.resize_num_qa_labels(num_large_labels)
  
      result_pretrain_more = model_pretrain(
          input_ids,
          visual_feats,
          bounding_boxes,
          token_type_ids=token_type_ids,
          attention_mask=input_mask,
          ans=more_labels_ans,
      )
  
      result_qa_more = model_qa(
          input_ids,
          visual_feats,
          bounding_boxes,
          labels=more_labels_ans,
          token_type_ids=token_type_ids,
          attention_mask=input_mask,
      )
  
      model_qa_labels = model_qa.num_qa_labels
  
      self.parent.assertNotEqual(start_labels, end_labels)
      self.parent.assertNotEqual(model_qa_labels, start_labels)
      self.parent.assertEqual(
          result_qa.question_answering_score.shape,
          (self.batch_size, start_labels),
      )
      self.parent.assertEqual(
          result_pretrain.question_answering_score.shape,
          (self.batch_size, start_labels),
      )
      self.parent.assertEqual(
          result_qa_less.question_answering_score.shape,
          (self.batch_size, num_small_labels),
      )
      self.parent.assertEqual(
          result_pretrain_less.question_answering_score.shape,
          (self.batch_size, num_small_labels),
      )
      self.parent.assertEqual(
          result_qa_more.question_answering_score.shape,
          (self.batch_size, num_large_labels),
      )
      self.parent.assertEqual(
          result_pretrain_more.question_answering_score.shape,
          (self.batch_size, num_large_labels),
      )
  
imports: import copy
  import unittest
  import numpy
  from transformers import LxmertConfig, is_tf_available, is_torch_available
  from transformers.models.auto import get_values
  from transformers.testing_utils import require_torch, slow, torch_device
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, ids_tensor
label_desc: Use image node_id 7 for calling the LxmertModelTester obj's underlying member method code with example usage: obj.resize_lxmert_num_qa_labels(config, input_ids, visual_feats, bounding_boxes, token_type_ids, input_mask, obj_labels, masked_lm_labels, matched_label, ans, output_attentions) without return types