code: def create_and_check_xlnet_base_model_with_att_output(
      self,
      config,
      input_ids_1,
      input_ids_2,
      input_ids_q,
      perm_mask,
      input_mask,
      target_mapping,
      segment_ids,
      lm_labels,
      sequence_labels,
      is_impossible_labels,
      token_labels,
  ):
      model = XLNetModel(config)
      model.to(torch_device)
      model.eval()
  
      attentions = model(
          input_ids_1,
          target_mapping=target_mapping,
          output_attentions=True,
      )["attentions"]
  
      self.parent.assertEqual(len(attentions), config.n_layer)
      self.parent.assertIsInstance(attentions[0], tuple)
      self.parent.assertEqual(len(attentions[0]), 2)
      self.parent.assertTrue(
          attentions[0][0].shape, attentions[0][0].shape
      )
  
imports: import random
  import unittest
  from transformers import XLNetConfig, is_torch_available
  from transformers.testing_utils import require_torch, slow, torch_device
  from ...generation.test_generation_utils import GenerationTesterMixin
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
label_desc: Use image node_id 8 for calling the XLNetModelTester obj's underlying member method code with example usage: obj.create_and_check_xlnet_base_model_with_att_output(config, input_ids_1, input_ids_2, input_ids_q, perm_mask, input_mask, target_mapping, segment_ids, lm_labels, sequence_labels, is_impossible_labels, token_labels) without return types