


import inspect
import unittest

from transformers import MobileViTVaConfig
from transformers.testing_utils import require_torch, require_torch_multi_gpu, 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 MobileViTVaForImageClassification, MobileViTVaForSemanticSegmentation, MobileViTVaModel
 from transformers.models.mobilevitva.modeling_mobilevitva import (
     MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST,
     make_divisible,
 )


if is_vision_available():
 from PIL import Image

 from transformers import MobileViTImageProcessor






class _lowerCamelCase(		_a  ):
       def      UpperCamelCase	(   self)			->  Any:




           """simple docstring"""

           _lowercase			:				Dict 						=						self.config_class(**self.inputs_dict)
           self.parent.assertTrue(hasattr(lowerCamelCase, 'width_multiplier'))






class _lowerCamelCase:
       def __init__(   self, lowerCamelCase, lowerCamelCase=13, lowerCamelCase=64, lowerCamelCase=2, lowerCamelCase=3, lowerCamelCase="swish", lowerCamelCase=3, lowerCamelCase=32, lowerCamelCase=0.1, lowerCamelCase=0.0_2, lowerCamelCase=True, lowerCamelCase=True, lowerCamelCase=10, lowerCamelCase=None, lowerCamelCase=0.2_5, lowerCamelCase=0.0, lowerCamelCase=0.0, )			->  str:




           """simple docstring"""

           _lowercase			:				Optional[Any] 						=						parent
           _lowercase			:				Optional[Any] 						=						batch_size
           _lowercase			:				List[str] 						=						image_size
           _lowercase			:				Optional[int] 						=						patch_size
           _lowercase			:				str 						=						num_channels
           _lowercase			:				Optional[int] 						=						make_divisible(5_12 * width_multiplier, divisor=8)
           _lowercase			:				Optional[Any] 						=						hidden_act
           _lowercase			:				List[Any] 						=						conv_kernel_size
           _lowercase			:				Any 						=						output_stride
           _lowercase			:				Optional[int] 						=						classifier_dropout_prob
           _lowercase			:				int 						=						use_labels
           _lowercase			:				Any 						=						is_training
           _lowercase			:				Optional[Any] 						=						num_labels
           _lowercase			:				List[Any] 						=						initializer_range
           _lowercase			:				int 						=						scope
           _lowercase			:				Optional[Any] 						=						width_multiplier
           _lowercase			:				List[Any] 						=						ffn_dropout
           _lowercase			:				List[Any] 						=						attn_dropout
       def      UpperCamelCase	(   self)			->  List[Any]:




           """simple docstring"""

           _lowercase			:				List[Any] 						=						floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size])

           _lowercase			:				Optional[int] 						=						None
           _lowercase			:				int 						=						None
           if self.use_labels:
               _lowercase			:				Any 						=						ids_tensor([self.batch_size], self.num_labels)
               _lowercase			:				List[str] 						=						ids_tensor([self.batch_size, self.image_size, self.image_size], self.num_labels)

           _lowercase			:				List[Any] 						=						self.get_config()

           return config, pixel_values, labels, pixel_labels
       def      UpperCamelCase	(   self)			->  Any:




           """simple docstring"""

           return MobileViTVaConfig(
               image_size=self.image_size, patch_size=self.patch_size, num_channels=self.num_channels, hidden_act=self.hidden_act, conv_kernel_size=self.conv_kernel_size, output_stride=self.output_stride, classifier_dropout_prob=self.classifier_dropout_prob, initializer_range=self.initializer_range, width_multiplier=self.width_multiplier, ffn_dropout=self.ffn_dropout_prob, attn_dropout=self.attn_dropout_prob, )
       def      UpperCamelCase	(   self, lowerCamelCase, lowerCamelCase, lowerCamelCase, lowerCamelCase)			->  Optional[int]:




           """simple docstring"""

           _lowercase			:				Optional[Any] 						=						MobileViTVaModel(config=lowerCamelCase)
           model.to(lowerCamelCase)
           model.eval()
           _lowercase			:				Tuple 						=						model(lowerCamelCase)
           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      UpperCamelCase	(   self, lowerCamelCase, lowerCamelCase, lowerCamelCase, lowerCamelCase)			->  Tuple:




           """simple docstring"""

           _lowercase			:				Dict 						=						self.num_labels
           _lowercase			:				Dict 						=						MobileViTVaForImageClassification(lowerCamelCase)
           model.to(lowerCamelCase)
           model.eval()
           _lowercase			:				Dict 						=						model(lowerCamelCase, labels=lowerCamelCase)
           self.parent.assertEqual(result.logits.shape, (self.batch_size, self.num_labels))
       def      UpperCamelCase	(   self, lowerCamelCase, lowerCamelCase, lowerCamelCase, lowerCamelCase)			->  int:




           """simple docstring"""

           _lowercase			:				List[str] 						=						self.num_labels
           _lowercase			:				Union[str, Any] 						=						MobileViTVaForSemanticSegmentation(lowerCamelCase)
           model.to(lowerCamelCase)
           model.eval()
           _lowercase			:				Union[str, Any] 						=						model(lowerCamelCase)
           self.parent.assertEqual(
               result.logits.shape, (
                   self.batch_size,
                   self.num_labels,
                   self.image_size // self.output_stride,
                   self.image_size // self.output_stride,
               ), )
           _lowercase			:				Union[str, Any] 						=						model(lowerCamelCase, labels=lowerCamelCase)
           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      UpperCamelCase	(   self)			->  Dict:




           """simple docstring"""

           _lowercase			:				Optional[int] 						=						self.prepare_config_and_inputs()
           _lowercase						,							_lowercase						,							_lowercase						,							_lowercase			:				List[Any] 						=						config_and_inputs
           _lowercase			:				Any 						=						{'pixel_values': pixel_values}
           return config, inputs_dict






@require_torch
class _lowerCamelCase(		_a,					_a,					unittest.TestCase  ):
       lowercase_					:      int       					=     (
           (MobileViTVaModel, MobileViTVaForImageClassification, MobileViTVaForSemanticSegmentation)
           if is_torch_available()
           else ()
       )

       lowercase_					:      List[str]       					=     (
           {
               """feature-extraction""": MobileViTVaModel,
               """image-classification""": MobileViTVaForImageClassification,
               """image-segmentation""": MobileViTVaForSemanticSegmentation,
           }
           if is_torch_available()
           else {}
       )

       lowercase_					:      Tuple       					=     False
       lowercase_					:      int       					=     False
       lowercase_					:      Union[str, Any]       					=     False
       lowercase_					:      str       					=     False
       def      UpperCamelCase	(   self)			->  Tuple:




           """simple docstring"""

           _lowercase			:				List[Any] 						=						MobileViTVaModelTester(self)
           _lowercase			:				Any 						=						MobileViTVaConfigTester(self, config_class=lowerCamelCase, has_text_modality=lowerCamelCase)
       def      UpperCamelCase	(   self)			->  Dict:




           """simple docstring"""

           self.config_tester.run_common_tests()
       @unittest.skip(reason='MobileViTV2 does not use inputs_embeds')
       def      UpperCamelCase	(   self)			->  Tuple:




           """simple docstring"""

           pass
       @unittest.skip(reason='MobileViTV2 does not support input and output embeddings')
       def      UpperCamelCase	(   self)			->  str:




           """simple docstring"""

           pass
       @unittest.skip(reason='MobileViTV2 does not output attentions')
       def      UpperCamelCase	(   self)			->  Tuple:




           """simple docstring"""

           pass
       @require_torch_multi_gpu
       @unittest.skip(reason='Got `CUDA error: misaligned address` for tests after this one being run.')
       def      UpperCamelCase	(   self)			->  Tuple:




           """simple docstring"""

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




           """simple docstring"""

           pass
       def      UpperCamelCase	(   self)			->  Dict:




           """simple docstring"""

           _lowercase						,							_lowercase			:				Dict 						=						self.model_tester.prepare_config_and_inputs_for_common()

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

               _lowercase			:				Union[str, Any] 						=						['pixel_values']
               self.assertListEqual(arg_names[:1], lowerCamelCase)
       def      UpperCamelCase	(   self)			->  Optional[int]:




           """simple docstring"""

           _lowercase			:				Dict 						=						self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_model(*lowerCamelCase)
       def      UpperCamelCase	(   self)			->  int:




           """simple docstring"""

           def check_hidden_states_output(lowerCamelCase, lowerCamelCase, lowerCamelCase):
               _lowercase			:				str 						=						model_class(lowerCamelCase)
               model.to(lowerCamelCase)
               model.eval()

               with torch.no_grad():
                   _lowercase			:				List[Any] 						=						model(**self._prepare_for_class(lowerCamelCase, lowerCamelCase))

               _lowercase			:				Optional[int] 						=						outputs.hidden_states

               _lowercase			:				Dict 						=						5
               self.assertEqual(len(lowerCamelCase), lowerCamelCase)

               # MobileViTV2's feature maps are of shape (batch_size, num_channels, height, width)
               # with the width and height being successively divided by 2.
               _lowercase			:				Dict 						=						2
               for i in range(len(lowerCamelCase)):
                   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)

           _lowercase						,							_lowercase			:				List[Any] 						=						self.model_tester.prepare_config_and_inputs_for_common()

           for model_class in self.all_model_classes:
               _lowercase			:				Tuple 						=						True
               check_hidden_states_output(lowerCamelCase, lowerCamelCase, lowerCamelCase)

               # check that output_hidden_states also work using config
               del inputs_dict["output_hidden_states"]
               _lowercase			:				Any 						=						True

               check_hidden_states_output(lowerCamelCase, lowerCamelCase, lowerCamelCase)
       def      UpperCamelCase	(   self)			->  Optional[Any]:




           """simple docstring"""

           _lowercase			:				List[Any] 						=						self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_for_image_classification(*lowerCamelCase)
       def      UpperCamelCase	(   self)			->  Dict:




           """simple docstring"""

           _lowercase			:				Optional[Any] 						=						self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_for_semantic_segmentation(*lowerCamelCase)




       @slow
       def      UpperCamelCase	(   self)			->  Any:




           """simple docstring"""

           for model_name in MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
               _lowercase			:				Union[str, Any] 						=						MobileViTVaModel.from_pretrained(lowerCamelCase)
               self.assertIsNotNone(lowerCamelCase)



def 							UpperCamelCase_( )       ->		Optional[int]:
    _lowercase			:				Optional[int] 						=						Image.open('./tests/fixtures/tests_samples/COCO/000000039769.png'					)
    return image






@require_torch
@require_vision
class _lowerCamelCase(		unittest.TestCase  ):
       @cached_property
       def      UpperCamelCase	(   self)			->  Union[str, Any]:




           """simple docstring"""

           return (
               MobileViTImageProcessor.from_pretrained('apple/mobilevitv2-1.0-imagenet1k-256')
               if is_vision_available()
               else None
           )
       @slow
       def      UpperCamelCase	(   self)			->  Optional[int]:




           """simple docstring"""

           _lowercase			:				List[Any] 						=						MobileViTVaForImageClassification.from_pretrained('apple/mobilevitv2-1.0-imagenet1k-256').to(
               lowerCamelCase)

           _lowercase			:				List[Any] 						=						self.default_image_processor
           _lowercase			:				Dict 						=						prepare_img()
           _lowercase			:				Any 						=						image_processor(images=lowerCamelCase, return_tensors='pt').to(lowerCamelCase)

           # forward pass
           with torch.no_grad():
               _lowercase			:				Union[str, Any] 						=						model(**lowerCamelCase)

           # verify the logits
           _lowercase			:				List[str] 						=						torch.Size((1, 10_00))
           self.assertEqual(outputs.logits.shape, lowerCamelCase)

           _lowercase			:				Dict 						=						torch.tensor([-1.63_36E00, -7.32_04E-02, -5.18_83E-01]).to(lowerCamelCase)

           self.assertTrue(torch.allclose(outputs.logits[0, :3], lowerCamelCase, atol=1E-4))
       @slow
       def      UpperCamelCase	(   self)			->  List[Any]:




           """simple docstring"""

           _lowercase			:				List[Any] 						=						MobileViTVaForSemanticSegmentation.from_pretrained('shehan97/mobilevitv2-1.0-voc-deeplabv3')
           _lowercase			:				Optional[int] 						=						model.to(lowerCamelCase)

           _lowercase			:				Optional[int] 						=						MobileViTImageProcessor.from_pretrained('shehan97/mobilevitv2-1.0-voc-deeplabv3')

           _lowercase			:				List[Any] 						=						prepare_img()
           _lowercase			:				Union[str, Any] 						=						image_processor(images=lowerCamelCase, return_tensors='pt').to(lowerCamelCase)

           # forward pass
           with torch.no_grad():
               _lowercase			:				List[str] 						=						model(**lowerCamelCase)
           _lowercase			:				Union[str, Any] 						=						outputs.logits

           # verify the logits
           _lowercase			:				List[Any] 						=						torch.Size((1, 21, 32, 32))
           self.assertEqual(logits.shape, lowerCamelCase)

           _lowercase			:				Dict 						=						torch.tensor(
               [
                   [[7.0_8_6_3, 7.1_5_2_5, 6.8_2_0_1], [6.6_9_3_1, 6.8_7_7_0, 6.8_9_3_3], [6.2_9_7_8, 7.0_3_6_6, 6.9_6_3_6]],
                   [[-3.7_1_3_4, -3.6_7_1_2, -3.6_6_7_5], [-3.5_8_2_5, -3.3_5_4_9, -3.4_7_7_7], [-3.3_4_3_5, -3.3_9_7_9, -3.2_8_5_7]],
                   [[-2.9_3_2_9, -2.8_0_0_3, -2.7_3_6_9], [-3.0_5_6_4, -2.4_7_8_0, -2.0_2_0_7], [-2.6_8_8_9, -1.9_2_9_8, -1.7_6_4_0]],
               ], device=lowerCamelCase, )

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




       @slow
       def      UpperCamelCase	(   self)			->  List[str]:




           """simple docstring"""

           _lowercase			:				Optional[Any] 						=						MobileViTVaForSemanticSegmentation.from_pretrained('shehan97/mobilevitv2-1.0-voc-deeplabv3')
           _lowercase			:				List[str] 						=						model.to(lowerCamelCase)

           _lowercase			:				Optional[int] 						=						MobileViTImageProcessor.from_pretrained('shehan97/mobilevitv2-1.0-voc-deeplabv3')

           _lowercase			:				List[str] 						=						prepare_img()
           _lowercase			:				List[str] 						=						image_processor(images=lowerCamelCase, return_tensors='pt').to(lowerCamelCase)

           # forward pass
           with torch.no_grad():
               _lowercase			:				Union[str, Any] 						=						model(**lowerCamelCase)

           _lowercase			:				Any 						=						outputs.logits.detach().cpu()

           _lowercase			:				Optional[Any] 						=						image_processor.post_process_semantic_segmentation(outputs=lowerCamelCase, target_sizes=[(50, 60)])
           _lowercase			:				Optional[Any] 						=						torch.Size((50, 60))
           self.assertEqual(segmentation[0].shape, lowerCamelCase)

           _lowercase			:				List[str] 						=						image_processor.post_process_semantic_segmentation(outputs=lowerCamelCase)
           _lowercase			:				Any 						=						torch.Size((32, 32))
           self.assertEqual(segmentation[0].shape, lowerCamelCase)




'''simple docstring'''




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 					A							(				__snake_case       ,     unittest.TestCase		):
     __magic_name__          =						DebertaTokenizer
     __magic_name__          =						True
     __magic_name__          =						DebertaTokenizerFast





     def 							__lowerCAmelCase				(				self      )					->							Tuple:






         """simple docstring"""






         super().setUp()

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

         A			:  Optional[int]   =		os.path.join(self.tmpdirname		,     VOCAB_FILES_NAMES['''vocab_file''']      )
         A			:  str   =		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(SCREAMING_SNAKE_CASE      ) + '''\n'''      )
         with open(self.merges_file		,     '''w'''		,     encoding='''utf-8'''      ) as fp:
             fp.write('''\n'''.join(SCREAMING_SNAKE_CASE      )      )





     def 							__lowerCAmelCase				(				self		,     **SCREAMING_SNAKE_CASE      )					->							Optional[Any]:






         """simple docstring"""






         kwargs.update(self.special_tokens_map      )
         return self.tokenizer_class.from_pretrained(self.tmpdirname		,     **SCREAMING_SNAKE_CASE      )





     def 							__lowerCAmelCase				(				self		,     SCREAMING_SNAKE_CASE      )					->							str:






         """simple docstring"""






         A			:  Union[str, Any]   =		'''lower newer'''
         A			:  List[Any]   =		'''lower newer'''
         return input_text, output_text





     def 							__lowerCAmelCase				(				self      )					->							str:






         """simple docstring"""






         A			:  str   =		self.get_tokenizer()
         A			:  List[str]   =		'''lower newer'''
         A			:  int   =		['''l''', '''o''', '''w''', '''er''', '''\u0120''', '''n''', '''e''', '''w''', '''er''']
         A			:  Any   =		tokenizer.tokenize(SCREAMING_SNAKE_CASE      )
         self.assertListEqual(SCREAMING_SNAKE_CASE		,     SCREAMING_SNAKE_CASE      )

         A			:  str   =		tokens + [tokenizer.unk_token]
         A			:  str   =		[0, 1, 2, 15, 10, 9, 3, 2, 15, 19]
         self.assertListEqual(tokenizer.convert_tokens_to_ids(SCREAMING_SNAKE_CASE      )		,     SCREAMING_SNAKE_CASE      )





     def 							__lowerCAmelCase				(				self      )					->							str:






         """simple docstring"""






         A			:  List[Any]   =		self.get_tokenizer()
         A			:  Tuple   =		tokenizer('''Hello'''		,     '''World'''      )
         A			:  str   =		[0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1]
         self.assertListEqual(tokd['''token_type_ids''']		,     SCREAMING_SNAKE_CASE      )





     @slow
     def 							__lowerCAmelCase				(				self      )					->							int:






         """simple docstring"""






         A			:  Union[str, Any]   =		self.tokenizer_class.from_pretrained('''microsoft/deberta-base'''      )

         A			:  Union[str, Any]   =		tokenizer.encode('''sequence builders'''		,     add_special_tokens=SCREAMING_SNAKE_CASE      )
         A			:  Any   =		tokenizer.encode('''multi-sequence build'''		,     add_special_tokens=SCREAMING_SNAKE_CASE      )

         A			:  Tuple   =		tokenizer.encode(
             '''sequence builders'''		,     add_special_tokens=SCREAMING_SNAKE_CASE		,     add_prefix_space=SCREAMING_SNAKE_CASE      )
         A			:  Union[str, Any]   =		tokenizer.encode(
             '''sequence builders'''		,     '''multi-sequence build'''		,     add_special_tokens=SCREAMING_SNAKE_CASE		,     add_prefix_space=SCREAMING_SNAKE_CASE      )

         A			:  List[str]   =		tokenizer.build_inputs_with_special_tokens(SCREAMING_SNAKE_CASE      )
         A			:  Union[str, Any]   =		tokenizer.build_inputs_with_special_tokens(SCREAMING_SNAKE_CASE		,     SCREAMING_SNAKE_CASE      )

         assert encoded_sentence == encoded_text_from_decode
         assert encoded_pair == encoded_pair_from_decode





     @slow
     def 							__lowerCAmelCase				(				self      )					->							int:






         """simple docstring"""






         A			:  Any   =		[self.tokenizer_class]
         if self.test_rust_tokenizer:
             tokenizer_classes.append(self.rust_tokenizer_class      )

         for tokenizer_class in tokenizer_classes:
             A			:  List[str]   =		tokenizer_class.from_pretrained('''microsoft/deberta-base'''      )

             A			:  Dict   =		[
                 '''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.''',
             ]

             A			:  List[Any]   =		tokenizer(SCREAMING_SNAKE_CASE		,     padding=SCREAMING_SNAKE_CASE      )
             A			:  List[str]   =		[tokenizer.decode(SCREAMING_SNAKE_CASE		,     skip_special_tokens=SCREAMING_SNAKE_CASE      ) for seq in encoding['''input_ids''']]

             # fmt: off
             A			:  List[str]   =		{
                 '''input_ids''': [
                     [1, 2118, 11126, 565, 35, 83, 25191, 163, 18854, 13, 12156, 12, 16101, 25376, 13807, 9, 22205, 27893, 1635, 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, 2118, 11126, 565, 24536, 80, 43797, 4878, 7373, 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, 3724, 1538, 33183, 11303, 43797, 1938, 4, 870, 24165, 29105, 5, 739, 32644, 33183, 11303, 36173, 88, 80, 650, 7821, 45940, 6, 52, 2559, 5, 1836, 9, 5, 7397, 13171, 31, 5, 1836, 9, 32644, 33183, 11303, 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

             A			:  Any   =		[
                 '''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		,     SCREAMING_SNAKE_CASE      )

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




