import inspect
import unittest

from transformers import MobileViTConfig
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
      import torch

      from transformers import MobileViTForImageClassification, MobileViTForSemanticSegmentation, MobileViTModel
      from transformers.models.mobilevit.modeling_mobilevit import MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
      from PIL import Image

      from transformers import MobileViTImageProcessor


class      lowerCamelCase    (SCREAMING_SNAKE_CASE__    ):
  """simple docstring"""







  def       __A   (							self       :				Optional[Any]      )     ->		Tuple:
        SCREAMING_SNAKE_CASE_      =     self.config_class(**self.inputs_dict      )
        self.parent.assertTrue(hasattr(__magic_name__     ,   "hidden_sizes"      )      )
        self.parent.assertTrue(hasattr(__magic_name__     ,   "neck_hidden_sizes"      )      )
        self.parent.assertTrue(hasattr(__magic_name__     ,   "num_attention_heads"      )      )



class      lowerCamelCase    :
  """simple docstring"""







  def __init__(							self       :				str     ,   __magic_name__       :				str     ,   __magic_name__       :				Optional[int]=13     ,   __magic_name__       :				int=32     ,   __magic_name__       :				List[Any]=2     ,   __magic_name__       :				List[Any]=3     ,   __magic_name__       :				Optional[Any]=640     ,   __magic_name__       :				Tuple=4     ,   __magic_name__       :				str="silu"     ,   __magic_name__       :				Optional[int]=3     ,   __magic_name__       :				Union[str, Any]=32     ,   __magic_name__       :				Tuple=0.1     ,   __magic_name__       :				List[str]=0.1     ,   __magic_name__       :				str=0.1     ,   __magic_name__       :				str=0.02     ,   __magic_name__       :				Optional[int]=True     ,   __magic_name__       :				Optional[int]=True     ,   __magic_name__       :				int=10     ,   __magic_name__       :				Union[str, Any]=None     ,   )     ->		Any:
        SCREAMING_SNAKE_CASE_      =     parent
        SCREAMING_SNAKE_CASE_      =     batch_size
        SCREAMING_SNAKE_CASE_      =     image_size
        SCREAMING_SNAKE_CASE_      =     patch_size
        SCREAMING_SNAKE_CASE_      =     num_channels
        SCREAMING_SNAKE_CASE_      =     last_hidden_size
        SCREAMING_SNAKE_CASE_      =     num_attention_heads
        SCREAMING_SNAKE_CASE_      =     hidden_act
        SCREAMING_SNAKE_CASE_      =     conv_kernel_size
        SCREAMING_SNAKE_CASE_      =     output_stride
        SCREAMING_SNAKE_CASE_      =     hidden_dropout_prob
        SCREAMING_SNAKE_CASE_      =     attention_probs_dropout_prob
        SCREAMING_SNAKE_CASE_      =     classifier_dropout_prob
        SCREAMING_SNAKE_CASE_      =     use_labels
        SCREAMING_SNAKE_CASE_      =     is_training
        SCREAMING_SNAKE_CASE_      =     num_labels
        SCREAMING_SNAKE_CASE_      =     initializer_range
        SCREAMING_SNAKE_CASE_      =     scope







  def       __A   (							self       :				Tuple      )     ->		Any:
        SCREAMING_SNAKE_CASE_      =     floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]      )

        SCREAMING_SNAKE_CASE_      =     None
        SCREAMING_SNAKE_CASE_      =     None
        if self.use_labels:
              SCREAMING_SNAKE_CASE_      =     ids_tensor([self.batch_size]     ,   self.num_labels      )
              SCREAMING_SNAKE_CASE_      =     ids_tensor([self.batch_size, self.image_size, self.image_size]     ,   self.num_labels      )

        SCREAMING_SNAKE_CASE_      =     self.get_config()

        return config, pixel_values, labels, pixel_labels







  def       __A   (							self       :				Optional[Any]      )     ->		Optional[int]:
        return MobileViTConfig(
            image_size=self.image_size     ,   patch_size=self.patch_size     ,   num_channels=self.num_channels     ,   num_attention_heads=self.num_attention_heads     ,   hidden_act=self.hidden_act     ,   conv_kernel_size=self.conv_kernel_size     ,   output_stride=self.output_stride     ,   hidden_dropout_prob=self.hidden_dropout_prob     ,   attention_probs_dropout_prob=self.attention_probs_dropout_prob     ,   classifier_dropout_prob=self.classifier_dropout_prob     ,   initializer_range=self.initializer_range     ,   )







  def       __A   (							self       :				Optional[Any]     ,   __magic_name__       :				Union[str, Any]     ,   __magic_name__       :				Any     ,   __magic_name__       :				Any     ,   __magic_name__       :				List[Any]      )     ->		Optional[int]:
        SCREAMING_SNAKE_CASE_      =     MobileViTModel(config=__magic_name__      )
        model.to(__magic_name__      )
        model.eval()
        SCREAMING_SNAKE_CASE_      =     model(__magic_name__      )
        self.parent.assertEqual(
            result.last_hidden_state.shape     ,   (
                self.batch_size,
                self.last_hidden_size,
                self.image_size // self.output_stride,
                self.image_size // self.output_stride,
            )     ,   )







  def       __A   (							self       :				Union[str, Any]     ,   __magic_name__       :				Union[str, Any]     ,   __magic_name__       :				Optional[Any]     ,   __magic_name__       :				Union[str, Any]     ,   __magic_name__       :				Optional[int]      )     ->		Any:
        SCREAMING_SNAKE_CASE_      =     self.num_labels
        SCREAMING_SNAKE_CASE_      =     MobileViTForImageClassification(__magic_name__      )
        model.to(__magic_name__      )
        model.eval()
        SCREAMING_SNAKE_CASE_      =     model(__magic_name__     ,   labels=__magic_name__      )
        self.parent.assertEqual(result.logits.shape     ,   (self.batch_size, self.num_labels)      )







  def       __A   (							self       :				int     ,   __magic_name__       :				Union[str, Any]     ,   __magic_name__       :				List[str]     ,   __magic_name__       :				List[str]     ,   __magic_name__       :				Any      )     ->		str:
        SCREAMING_SNAKE_CASE_      =     self.num_labels
        SCREAMING_SNAKE_CASE_      =     MobileViTForSemanticSegmentation(__magic_name__      )
        model.to(__magic_name__      )
        model.eval()
        SCREAMING_SNAKE_CASE_      =     model(__magic_name__      )
        self.parent.assertEqual(
            result.logits.shape     ,   (
                self.batch_size,
                self.num_labels,
                self.image_size // self.output_stride,
                self.image_size // self.output_stride,
            )     ,   )
        SCREAMING_SNAKE_CASE_      =     model(__magic_name__     ,   labels=__magic_name__      )
        self.parent.assertEqual(
            result.logits.shape     ,   (
                self.batch_size,
                self.num_labels,
                self.image_size // self.output_stride,
                self.image_size // self.output_stride,
            )     ,   )







  def       __A   (							self       :				int      )     ->		Tuple:
        SCREAMING_SNAKE_CASE_      =     self.prepare_config_and_inputs()
        SCREAMING_SNAKE_CASE_   ,       SCREAMING_SNAKE_CASE_   ,       SCREAMING_SNAKE_CASE_   ,       SCREAMING_SNAKE_CASE_      =     config_and_inputs
        SCREAMING_SNAKE_CASE_      =     {"pixel_values": pixel_values}
        return config, inputs_dict



@require_torch
class      lowerCamelCase    (SCREAMING_SNAKE_CASE__     ,					SCREAMING_SNAKE_CASE__     ,					unittest.TestCase    ):
  """simple docstring"""







  lowerCamelCase__   =  (
      (MobileViTModel, MobileViTForImageClassification, MobileViTForSemanticSegmentation)
      if is_torch_available()
      else ()
  )
  lowerCamelCase__   =  (
      {
          '''feature-extraction''': MobileViTModel,
          '''image-classification''': MobileViTForImageClassification,
          '''image-segmentation''': MobileViTForSemanticSegmentation,
      }
      if is_torch_available()
      else {}
  )

  lowerCamelCase__   =  False
  lowerCamelCase__   =  False
  lowerCamelCase__   =  False
  lowerCamelCase__   =  False







  def       __A   (							self       :				Union[str, Any]      )     ->		Union[str, Any]:
        SCREAMING_SNAKE_CASE_      =     MobileViTModelTester(self      )
        SCREAMING_SNAKE_CASE_      =     MobileViTConfigTester(self     ,   config_class=__magic_name__     ,   has_text_modality=__magic_name__      )







  def       __A   (							self       :				Optional[int]      )     ->		int:
        self.config_tester.run_common_tests()







  @unittest.skip(reason="MobileViT does not use inputs_embeds"      )
  def       __A   (							self       :				Any      )     ->		List[str]:
        pass







  @unittest.skip(reason="MobileViT does not support input and output embeddings"      )
  def       __A   (							self       :				Optional[Any]      )     ->		int:
        pass







  @unittest.skip(reason="MobileViT does not output attentions"      )
  def       __A   (							self       :				Tuple      )     ->		Optional[Any]:
        pass







  def       __A   (							self       :				Union[str, Any]      )     ->		List[str]:
        SCREAMING_SNAKE_CASE_   ,       SCREAMING_SNAKE_CASE_      =     self.model_tester.prepare_config_and_inputs_for_common()

        for model_class in self.all_model_classes:
              SCREAMING_SNAKE_CASE_      =     model_class(__magic_name__      )
              SCREAMING_SNAKE_CASE_      =     inspect.signature(model.forward      )
              # signature.parameters is an OrderedDict => so arg_names order is deterministic
              SCREAMING_SNAKE_CASE_      =     [*signature.parameters.keys()]

              SCREAMING_SNAKE_CASE_      =     ["pixel_values"]
              self.assertListEqual(arg_names[:1]     ,   __magic_name__      )







  @unittest.skip("Will be fixed soon by reducing the size of the model used for common tests."      )
  def       __A   (							self       :				Tuple      )     ->		int:
        pass







  def       __A   (							self       :				Optional[int]      )     ->		List[Any]:
        SCREAMING_SNAKE_CASE_      =     self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_model(*__magic_name__      )







  def       __A   (							self       :				List[str]      )     ->		int:
        def check_hidden_states_output(__magic_name__       :				int     ,   __magic_name__       :				List[Any]     ,   __magic_name__       :				Tuple      ):
              SCREAMING_SNAKE_CASE_      =     model_class(__magic_name__      )
              model.to(__magic_name__      )
              model.eval()

              with torch.no_grad():
                    SCREAMING_SNAKE_CASE_      =     model(**self._prepare_for_class(__magic_name__     ,   __magic_name__      )      )

              SCREAMING_SNAKE_CASE_      =     outputs.hidden_states

              SCREAMING_SNAKE_CASE_      =     5
              self.assertEqual(len(__magic_name__      )     ,   __magic_name__      )

              # MobileViT's feature maps are of shape (batch_size, num_channels, height, width)
              # with the width and height being successively divided by 2.
              SCREAMING_SNAKE_CASE_      =     2
              for i in range(len(__magic_name__      )      ):
                    self.assertListEqual(
                        list(hidden_states[i].shape[-2:]      )     ,   [self.model_tester.image_size // divisor, self.model_tester.image_size // divisor]     ,   )
                    divisor *= 2

              self.assertEqual(self.model_tester.output_stride     ,   divisor // 2      )

        SCREAMING_SNAKE_CASE_   ,       SCREAMING_SNAKE_CASE_      =     self.model_tester.prepare_config_and_inputs_for_common()

        for model_class in self.all_model_classes:
              SCREAMING_SNAKE_CASE_      =     True
              check_hidden_states_output(__magic_name__     ,   __magic_name__     ,   __magic_name__      )

              # check that output_hidden_states also work using config
              del inputs_dict["output_hidden_states"]
              SCREAMING_SNAKE_CASE_      =     True

              check_hidden_states_output(__magic_name__     ,   __magic_name__     ,   __magic_name__      )







  def       __A   (							self       :				int      )     ->		Union[str, Any]:
        SCREAMING_SNAKE_CASE_      =     self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_image_classification(*__magic_name__      )







  def       __A   (							self       :				Optional[Any]      )     ->		Any:
        SCREAMING_SNAKE_CASE_      =     self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_semantic_segmentation(*__magic_name__      )







  @slow
  def       __A   (							self       :				Tuple      )     ->		str:
        for model_name in MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
              SCREAMING_SNAKE_CASE_      =     MobileViTModel.from_pretrained(__magic_name__      )
              self.assertIsNotNone(__magic_name__      )



def    a__       (						):
      SCREAMING_SNAKE_CASE_      =     Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png" )
      return image





@require_torch
@require_vision
class      lowerCamelCase    (unittest.TestCase    ):
  """simple docstring"""







  @cached_property
  def       __A   (							self       :				List[str]      )     ->		Dict:
        return MobileViTImageProcessor.from_pretrained("apple/mobilevit-xx-small"      ) if is_vision_available() else None







  @slow
  def       __A   (							self       :				List[Any]      )     ->		List[str]:
        SCREAMING_SNAKE_CASE_      =     MobileViTForImageClassification.from_pretrained("apple/mobilevit-xx-small"      ).to(__magic_name__      )

        SCREAMING_SNAKE_CASE_      =     self.default_image_processor
        SCREAMING_SNAKE_CASE_      =     prepare_img()
        SCREAMING_SNAKE_CASE_      =     image_processor(images=__magic_name__     ,   return_tensors="pt"      ).to(__magic_name__      )

        # forward pass
        with torch.no_grad():
              SCREAMING_SNAKE_CASE_      =     model(**__magic_name__      )

        # verify the logits
        SCREAMING_SNAKE_CASE_      =     torch.Size((1, 1_000)      )
        self.assertEqual(outputs.logits.shape     ,   __magic_name__      )

        SCREAMING_SNAKE_CASE_      =     torch.tensor([-1.9364, -1.2327, -0.4653]      ).to(__magic_name__      )

        self.assertTrue(torch.allclose(outputs.logits[0, :3]     ,   __magic_name__     ,   atol=1e-4      )      )







  @slow
  def       __A   (							self       :				List[str]      )     ->		Tuple:
        SCREAMING_SNAKE_CASE_      =     MobileViTForSemanticSegmentation.from_pretrained("apple/deeplabv3-mobilevit-xx-small"      )
        SCREAMING_SNAKE_CASE_      =     model.to(__magic_name__      )

        SCREAMING_SNAKE_CASE_      =     MobileViTImageProcessor.from_pretrained("apple/deeplabv3-mobilevit-xx-small"      )

        SCREAMING_SNAKE_CASE_      =     prepare_img()
        SCREAMING_SNAKE_CASE_      =     image_processor(images=__magic_name__     ,   return_tensors="pt"      ).to(__magic_name__      )

        # forward pass
        with torch.no_grad():
              SCREAMING_SNAKE_CASE_      =     model(**__magic_name__      )
        SCREAMING_SNAKE_CASE_      =     outputs.logits

        # verify the logits
        SCREAMING_SNAKE_CASE_      =     torch.Size((1, 21, 32, 32)      )
        self.assertEqual(logits.shape     ,   __magic_name__      )

        SCREAMING_SNAKE_CASE_      =     torch.tensor(
            [
                [[6.9713, 6.9786, 7.2422], [7.2893, 7.2825, 7.4446], [7.6580, 7.8797, 7.9420]],
                [[-10.6869, -10.3250, -10.3471], [-10.4228, -9.9868, -9.7132], [-11.0405, -11.0221, -10.7318]],
                [[-3.3089, -2.8539, -2.6740], [-3.2706, -2.5621, -2.5108], [-3.2534, -2.6615, -2.6651]],
            ]     ,   device=__magic_name__     ,   )

        self.assertTrue(torch.allclose(logits[0, :3, :3, :3]     ,   __magic_name__     ,   atol=1e-4      )      )







  @slow
  def       __A   (							self       :				Tuple      )     ->		Tuple:
        SCREAMING_SNAKE_CASE_      =     MobileViTForSemanticSegmentation.from_pretrained("apple/deeplabv3-mobilevit-xx-small"      )
        SCREAMING_SNAKE_CASE_      =     model.to(__magic_name__      )

        SCREAMING_SNAKE_CASE_      =     MobileViTImageProcessor.from_pretrained("apple/deeplabv3-mobilevit-xx-small"      )

        SCREAMING_SNAKE_CASE_      =     prepare_img()
        SCREAMING_SNAKE_CASE_      =     image_processor(images=__magic_name__     ,   return_tensors="pt"      ).to(__magic_name__      )

        # forward pass
        with torch.no_grad():
              SCREAMING_SNAKE_CASE_      =     model(**__magic_name__      )

        SCREAMING_SNAKE_CASE_      =     outputs.logits.detach().cpu()

        SCREAMING_SNAKE_CASE_      =     image_processor.post_process_semantic_segmentation(outputs=__magic_name__     ,   target_sizes=[(50, 60)]      )
        SCREAMING_SNAKE_CASE_      =     torch.Size((50, 60)      )
        self.assertEqual(segmentation[0].shape     ,   __magic_name__      )

        SCREAMING_SNAKE_CASE_      =     image_processor.post_process_semantic_segmentation(outputs=__magic_name__      )
        SCREAMING_SNAKE_CASE_      =     torch.Size((32, 32)      )
        self.assertEqual(segmentation[0].shape     ,   __magic_name__      )



import json
import os
import unittest

from transformers import DebertaTokenizer, DebertaTokenizerFast
from transformers.models.deberta.tokenization_deberta import VOCAB_FILES_NAMES
from transformers.testing_utils import slow

from ...test_tokenization_common import TokenizerTesterMixin


class      lowerCamelCase    (SCREAMING_SNAKE_CASE__     ,					unittest.TestCase    ):
  """simple docstring"""







  lowerCamelCase__   =  DebertaTokenizer
  lowerCamelCase__   =  True
  lowerCamelCase__   =  DebertaTokenizerFast







  def       __A   (							self       :				List[Any]      )     ->		Dict:
        super().setUp()

        # Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt
        SCREAMING_SNAKE_CASE_      =     [
            "l",
            "o",
            "w",
            "e",
            "r",
            "s",
            "t",
            "i",
            "d",
            "n",
            "\u0120",
            "\u0120l",
            "\u0120n",
            "\u0120lo",
            "\u0120low",
            "er",
            "\u0120lowest",
            "\u0120newer",
            "\u0120wider",
            "[UNK]",
        ]
        SCREAMING_SNAKE_CASE_      =     dict(zip(__magic_name__     ,   range(len(__magic_name__      )      )      )      )
        SCREAMING_SNAKE_CASE_      =     ["#version: 0.2", "\u0120 l", "\u0120l o", "\u0120lo w", "e r", ""]
        SCREAMING_SNAKE_CASE_      =     {"unk_token": "[UNK]"}

        SCREAMING_SNAKE_CASE_      =     os.path.join(self.tmpdirname     ,   VOCAB_FILES_NAMES["vocab_file"]      )
        SCREAMING_SNAKE_CASE_      =     os.path.join(self.tmpdirname     ,   VOCAB_FILES_NAMES["merges_file"]      )
        with open(self.vocab_file     ,   "w"     ,   encoding="utf-8"      ) as fp:
              fp.write(json.dumps(__magic_name__      ) + "\n"      )
        with open(self.merges_file     ,   "w"     ,   encoding="utf-8"      ) as fp:
              fp.write("\n".join(__magic_name__      )      )







  def       __A   (							self       :				str     ,   **__magic_name__       :				int      )     ->		Union[str, Any]:
        kwargs.update(self.special_tokens_map      )
        return self.tokenizer_class.from_pretrained(self.tmpdirname     ,   **__magic_name__      )







  def       __A   (							self       :				str     ,   __magic_name__       :				List[Any]      )     ->		Dict:
        SCREAMING_SNAKE_CASE_      =     "lower newer"
        SCREAMING_SNAKE_CASE_      =     "lower newer"
        return input_text, output_text







  def       __A   (							self       :				Union[str, Any]      )     ->		str:
        SCREAMING_SNAKE_CASE_      =     self.get_tokenizer()
        SCREAMING_SNAKE_CASE_      =     "lower newer"
        SCREAMING_SNAKE_CASE_      =     ["l", "o", "w", "er", "\u0120", "n", "e", "w", "er"]
        SCREAMING_SNAKE_CASE_      =     tokenizer.tokenize(__magic_name__      )
        self.assertListEqual(__magic_name__     ,   __magic_name__      )

        SCREAMING_SNAKE_CASE_      =     tokens + [tokenizer.unk_token]
        SCREAMING_SNAKE_CASE_      =     [0, 1, 2, 15, 10, 9, 3, 2, 15, 19]
        self.assertListEqual(tokenizer.convert_tokens_to_ids(__magic_name__      )     ,   __magic_name__      )







  def       __A   (							self       :				Optional[int]      )     ->		Optional[Any]:
        SCREAMING_SNAKE_CASE_      =     self.get_tokenizer()
        SCREAMING_SNAKE_CASE_      =     tokenizer("Hello"     ,   "World"      )
        SCREAMING_SNAKE_CASE_      =     [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1]
        self.assertListEqual(tokd["token_type_ids"]     ,   __magic_name__      )







  @slow
  def       __A   (							self       :				Any      )     ->		Any:
        SCREAMING_SNAKE_CASE_      =     self.tokenizer_class.from_pretrained("microsoft/deberta-base"      )

        SCREAMING_SNAKE_CASE_      =     tokenizer.encode("sequence builders"     ,   add_special_tokens=__magic_name__      )
        SCREAMING_SNAKE_CASE_      =     tokenizer.encode("multi-sequence build"     ,   add_special_tokens=__magic_name__      )

        SCREAMING_SNAKE_CASE_      =     tokenizer.encode(
            "sequence builders"     ,   add_special_tokens=__magic_name__     ,   add_prefix_space=__magic_name__      )
        SCREAMING_SNAKE_CASE_      =     tokenizer.encode(
            "sequence builders"     ,   "multi-sequence build"     ,   add_special_tokens=__magic_name__     ,   add_prefix_space=__magic_name__      )

        SCREAMING_SNAKE_CASE_      =     tokenizer.build_inputs_with_special_tokens(__magic_name__      )
        SCREAMING_SNAKE_CASE_      =     tokenizer.build_inputs_with_special_tokens(__magic_name__     ,   __magic_name__      )

        assert encoded_sentence == encoded_text_from_decode
        assert encoded_pair == encoded_pair_from_decode







  @slow
  def       __A   (							self       :				Tuple      )     ->		str:
        SCREAMING_SNAKE_CASE_      =     [self.tokenizer_class]
        if self.test_rust_tokenizer:
              tokenizer_classes.append(self.rust_tokenizer_class      )

        for tokenizer_class in tokenizer_classes:
              SCREAMING_SNAKE_CASE_      =     tokenizer_class.from_pretrained("microsoft/deberta-base"      )

              SCREAMING_SNAKE_CASE_      =     [
                  "ALBERT: A Lite BERT for Self-supervised Learning of Language Representations",
                  "ALBERT incorporates two parameter reduction techniques",
                  "The first one is a factorized embedding parameterization. By decomposing the large vocabulary"
                  " embedding matrix into two small matrices, we separate the size of the hidden layers from the size of"
                  " vocabulary embedding.",
              ]

              SCREAMING_SNAKE_CASE_      =     tokenizer(__magic_name__     ,   padding=__magic_name__      )
              SCREAMING_SNAKE_CASE_      =     [tokenizer.decode(__magic_name__     ,   skip_special_tokens=__magic_name__      ) for seq in encoding["input_ids"]]

              # fmt: off
              SCREAMING_SNAKE_CASE_      =     {
                  "input_ids": [
                      [1, 2_118, 11_126, 565, 35, 83, 25_191, 163, 18_854, 13, 12_156, 12, 16_101, 25_376, 13_807, 9, 22_205, 27_893, 1_635, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                      [1, 2_118, 11_126, 565, 24_536, 80, 43_797, 4_878, 7_373, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                      [1, 133, 78, 65, 16, 10, 3_724, 1_538, 33_183, 11_303, 43_797, 1_938, 4, 870, 24_165, 29_105, 5, 739, 32_644, 33_183, 11_303, 36_173, 88, 80, 650, 7_821, 45_940, 6, 52, 2_559, 5, 1_836, 9, 5, 7_397, 13_171, 31, 5, 1_836, 9, 32_644, 33_183, 11_303, 4, 2]
                  ],
                  "token_type_ids": [
                      [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                      [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                      [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
                  ],
                  "attention_mask": [
                      [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                      [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                      [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
                  ]
              }
              # fmt: on

              SCREAMING_SNAKE_CASE_      =     [
                  "ALBERT: A Lite BERT for Self-supervised Learning of Language Representations",
                  "ALBERT incorporates two parameter reduction techniques",
                  "The first one is a factorized embedding parameterization. By decomposing the large vocabulary"
                  " embedding matrix into two small matrices, we separate the size of the hidden layers from the size of"
                  " vocabulary embedding.",
              ]

              self.assertDictEqual(encoding.data     ,   __magic_name__      )

              for expected, decoded in zip(__magic_name__     ,   __magic_name__      ):
                    self.assertEqual(__magic_name__     ,   __magic_name__      )


