code: def test_entity_pair_classification_padding_pytorch_tensors(self):
      tokenizer = self.entity_pair_tokenizer
  
      sentence = "Japanese is an East Asian language spoken by about 128 million people, primarily in Japan."
      # head and tail information
      spans = [(0, 8), (84, 89)]
  
      encoding = tokenizer(
          sentence,
          entity_spans=spans,
          return_token_type_ids=True,
          padding="max_length",
          max_length=30,
          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, 2))
      self.assertEqual(encoding["entity_attention_mask"].shape, (1, 2))
      self.assertEqual(encoding["entity_token_type_ids"].shape, (1, 2))
      self.assertEqual(
          encoding["entity_position_ids"].shape,
          (
              1,
              tokenizer.max_entity_length,
              tokenizer.max_mention_length,
          ),
      )
  
imports: import unittest
  from typing import Tuple
  from transformers.models.mluke.tokenization_mluke import MLukeTokenizer
  from transformers.testing_utils import get_tests_dir, require_torch, slow
  from ...test_tokenization_common import TokenizerTesterMixin
label_desc: Use image node_id 11 for calling the MLukeTokenizerIntegrationTests obj's underlying member method code with example usage: obj.test_entity_pair_classification_padding_pytorch_tensors() without return types