code: def test_entity_span_classification_padding_pytorch_tensors(self):
      tokenizer = LukeTokenizer.from_pretrained(
          "studio-ousia/luke-base",
          task="entity_span_classification",
          return_token_type_ids=True,
      )
      sentence = "Top seed Ana Ivanovic said on Thursday she could hardly believe her luck."
      spans = [(0, 8), (9, 21), (39, 42)]
  
      encoding = tokenizer(
          sentence,
          entity_spans=spans,
          return_token_type_ids=True,
          padding="max_length",
          max_length=30,
          max_entity_length=16,
          return_tensors="pt",
      )
  
      # test words
      self.assertEqual(encoding["input_ids"].shape, (1, 30))
      self.assertEqual(encoding["attention_mask"].shape, (1, 30))
      self.assertEqual(encoding["token_type_ids"].shape, (1, 30))
  
      # test entities
      self.assertEqual(encoding["entity_ids"].shape, (1, 16))
      self.assertEqual(encoding["entity_attention_mask"].shape, (1, 16))
      self.assertEqual(encoding["entity_token_type_ids"].shape, (1, 16))
      self.assertEqual(
          encoding["entity_position_ids"].shape,
          (1, 16, tokenizer.max_mention_length),
      )
      self.assertEqual(
          encoding["entity_start_positions"].shape, (1, 16)
      )
      self.assertEqual(encoding["entity_end_positions"].shape, (1, 16))
  
imports: import unittest
  from typing import Tuple
  from transformers import AddedToken, LukeTokenizer
  from transformers.testing_utils import get_tests_dir, require_torch, slow
  from ...test_tokenization_common import TokenizerTesterMixin
label_desc: Use image node_id 13 for calling the LukeTokenizerIntegrationTests obj's underlying member method code with example usage: obj.test_entity_span_classification_padding_pytorch_tensors() without return types