


from __future__ import annotations

import unittest

from transformers import DistilBertConfig, is_tf_available
from transformers.testing_utils import require_tf, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
     import tensorflow as tf

     from transformers.models.distilbert.modeling_tf_distilbert import (
         TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
         TFDistilBertForMaskedLM,
         TFDistilBertForMultipleChoice,
         TFDistilBertForQuestionAnswering,
         TFDistilBertForSequenceClassification,
         TFDistilBertForTokenClassification,
         TFDistilBertModel,
     )






class   _lowerCamelCase :




       """simple docstring"""



       def __init__(      self				,       _SCREAMING_SNAKE_CASE				,       )->Optional[int]:




         '''simple docstring'''





         A_      :				List[Any]		     =					parent
         A_      :				Dict		     =					13
         A_      :				Dict		     =					7
         A_      :				str		     =					True
         A_      :				List[str]		     =					True
         A_      :				Dict		     =					False
         A_      :				Optional[int]		     =					True
         A_      :				Optional[int]		     =					99
         A_      :				List[Any]		     =					32
         A_      :				Tuple		     =					2
         A_      :				Tuple		     =					4
         A_      :				List[str]		     =					37
         A_      :				Any		     =					'''gelu'''
         A_      :				Tuple		     =					0.1
         A_      :				int		     =					0.1
         A_      :				str		     =					512
         A_      :				str		     =					16
         A_      :				List[str]		     =					2
         A_      :				Dict		     =					0.0_2
         A_      :				Optional[int]		     =					3
         A_      :				Union[str, Any]		     =					4
         A_      :				str		     =					None



       def        _snake_case       (      self		)->str:




         '''simple docstring'''





         A_      :				str		     =					ids_tensor([self.batch_size, self.seq_length]				,       self.vocab_size		)

         A_      :				Tuple		     =					None
         if self.use_input_mask:
           A_      :				Union[str, Any]		     =					random_attention_mask([self.batch_size, self.seq_length]		)

         A_      :				int		     =					None
         A_      :				Tuple		     =					None
         A_      :				List[str]		     =					None
         if self.use_labels:
           A_      :				List[Any]		     =					ids_tensor([self.batch_size]				,       self.type_sequence_label_size		)
           A_      :				Any		     =					ids_tensor([self.batch_size, self.seq_length]				,       self.num_labels		)
           A_      :				Union[str, Any]		     =					ids_tensor([self.batch_size]				,       self.num_choices		)

         A_      :				List[Any]		     =					DistilBertConfig(
             vocab_size=self.vocab_size				,       dim=self.hidden_size				,       n_layers=self.num_hidden_layers				,       n_heads=self.num_attention_heads				,       hidden_dim=self.intermediate_size				,       hidden_act=self.hidden_act				,       dropout=self.hidden_dropout_prob				,       attention_dropout=self.attention_probs_dropout_prob				,       max_position_embeddings=self.max_position_embeddings				,       initializer_range=self.initializer_range				,       )

         return config, input_ids, input_mask, sequence_labels, token_labels, choice_labels



       def        _snake_case       (      self				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE		)->List[Any]:




         '''simple docstring'''





         A_      :				str		     =					TFDistilBertModel(config=_SCREAMING_SNAKE_CASE		)
         A_      :				List[Any]		     =					{'''input_ids''': input_ids, '''attention_mask''': input_mask}

         A_      :				List[Any]		     =					model(_SCREAMING_SNAKE_CASE		)

         A_      :				int		     =					[input_ids, input_mask]

         A_      :				int		     =					model(_SCREAMING_SNAKE_CASE		)

         self.parent.assertEqual(result.last_hidden_state.shape				,       (self.batch_size, self.seq_length, self.hidden_size)		)



       def        _snake_case       (      self				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE		)->Optional[int]:




         '''simple docstring'''





         A_      :				List[str]		     =					TFDistilBertForMaskedLM(config=_SCREAMING_SNAKE_CASE		)
         A_      :				Any		     =					{'''input_ids''': input_ids, '''attention_mask''': input_mask}
         A_      :				List[Any]		     =					model(_SCREAMING_SNAKE_CASE		)
         self.parent.assertEqual(result.logits.shape				,       (self.batch_size, self.seq_length, self.vocab_size)		)



       def        _snake_case       (      self				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE		)->List[Any]:




         '''simple docstring'''





         A_      :				List[Any]		     =					TFDistilBertForQuestionAnswering(config=_SCREAMING_SNAKE_CASE		)
         A_      :				List[Any]		     =					{
             '''input_ids''': input_ids,
             '''attention_mask''': input_mask,
         }
         A_      :				Dict		     =					model(_SCREAMING_SNAKE_CASE		)
         self.parent.assertEqual(result.start_logits.shape				,       (self.batch_size, self.seq_length)		)
         self.parent.assertEqual(result.end_logits.shape				,       (self.batch_size, self.seq_length)		)



       def        _snake_case       (      self				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE		)->List[Any]:




         '''simple docstring'''





         A_      :				Optional[int]		     =					self.num_labels
         A_      :				Optional[int]		     =					TFDistilBertForSequenceClassification(_SCREAMING_SNAKE_CASE		)
         A_      :				List[Any]		     =					{'''input_ids''': input_ids, '''attention_mask''': input_mask}
         A_      :				int		     =					model(_SCREAMING_SNAKE_CASE		)
         self.parent.assertEqual(result.logits.shape				,       (self.batch_size, self.num_labels)		)



       def        _snake_case       (      self				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE		)->Any:




         '''simple docstring'''





         A_      :				str		     =					self.num_choices
         A_      :				Tuple		     =					TFDistilBertForMultipleChoice(_SCREAMING_SNAKE_CASE		)
         A_      :				List[str]		     =					tf.tile(tf.expand_dims(_SCREAMING_SNAKE_CASE				,       1		)				,       (1, self.num_choices, 1)		)
         A_      :				Tuple		     =					tf.tile(tf.expand_dims(_SCREAMING_SNAKE_CASE				,       1		)				,       (1, self.num_choices, 1)		)
         A_      :				Any		     =					{
             '''input_ids''': multiple_choice_inputs_ids,
             '''attention_mask''': multiple_choice_input_mask,
         }
         A_      :				List[Any]		     =					model(_SCREAMING_SNAKE_CASE		)
         self.parent.assertEqual(result.logits.shape				,       (self.batch_size, self.num_choices)		)



       def        _snake_case       (      self				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE		)->int:




         '''simple docstring'''





         A_      :				Dict		     =					self.num_labels
         A_      :				Any		     =					TFDistilBertForTokenClassification(_SCREAMING_SNAKE_CASE		)
         A_      :				Union[str, Any]		     =					{'''input_ids''': input_ids, '''attention_mask''': input_mask}
         A_      :				Tuple		     =					model(_SCREAMING_SNAKE_CASE		)
         self.parent.assertEqual(result.logits.shape				,       (self.batch_size, self.seq_length, self.num_labels)		)







       def        _snake_case       (      self		)->Optional[Any]:




         '''simple docstring'''





         A_      :				Any		     =					self.prepare_config_and_inputs()
         ((A_)     ,       (A_)     ,       (A_)     ,       (A_)     ,       (A_)     ,       (A_))      :				Tuple		     =					config_and_inputs
         A_      :				Optional[Any]		     =					{'''input_ids''': input_ids, '''attention_mask''': input_mask}
         return config, inputs_dict






@require_tf
class   _lowerCamelCase (					_UpperCAmelCase					,							_UpperCAmelCase					,							unittest.TestCase			):




       """simple docstring"""
       snake_case      =    (
           (
               TFDistilBertModel,
               TFDistilBertForMaskedLM,
               TFDistilBertForQuestionAnswering,
               TFDistilBertForSequenceClassification,
               TFDistilBertForTokenClassification,
               TFDistilBertForMultipleChoice,
           )
           if is_tf_available()
           else None
       )
       snake_case      =    (
           {
               "feature-extraction": TFDistilBertModel,
               "fill-mask": TFDistilBertForMaskedLM,
               "question-answering": TFDistilBertForQuestionAnswering,
               "text-classification": TFDistilBertForSequenceClassification,
               "token-classification": TFDistilBertForTokenClassification,
               "zero-shot": TFDistilBertForSequenceClassification,
           }
           if is_tf_available()
           else {}
       )
       snake_case      =    False
       snake_case      =    False



       def        _snake_case       (      self		)->Dict:




         '''simple docstring'''





         A_      :				int		     =					TFDistilBertModelTester(self		)
         A_      :				List[str]		     =					ConfigTester(self				,       config_class=_SCREAMING_SNAKE_CASE				,       dim=37		)



       def        _snake_case       (      self		)->str:




         '''simple docstring'''





         self.config_tester.run_common_tests()



       def        _snake_case       (      self		)->int:




         '''simple docstring'''





         A_      :				Optional[Any]		     =					self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_distilbert_model(*_SCREAMING_SNAKE_CASE		)



       def        _snake_case       (      self		)->Any:




         '''simple docstring'''





         A_      :				Optional[int]		     =					self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_distilbert_for_masked_lm(*_SCREAMING_SNAKE_CASE		)



       def        _snake_case       (      self		)->Optional[Any]:




         '''simple docstring'''





         A_      :				Union[str, Any]		     =					self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_distilbert_for_question_answering(*_SCREAMING_SNAKE_CASE		)



       def        _snake_case       (      self		)->Union[str, Any]:




         '''simple docstring'''





         A_      :				Dict		     =					self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_distilbert_for_sequence_classification(*_SCREAMING_SNAKE_CASE		)



       def        _snake_case       (      self		)->List[Any]:




         '''simple docstring'''





         A_      :				List[Any]		     =					self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_distilbert_for_multiple_choice(*_SCREAMING_SNAKE_CASE		)



       def        _snake_case       (      self		)->str:




         '''simple docstring'''





         A_      :				Tuple		     =					self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_distilbert_for_token_classification(*_SCREAMING_SNAKE_CASE		)







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




         '''simple docstring'''





         for model_name in list(TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]		):
           A_      :				str		     =					TFDistilBertModel.from_pretrained(_SCREAMING_SNAKE_CASE		)
           self.assertIsNotNone(_SCREAMING_SNAKE_CASE		)






@require_tf
class   _lowerCamelCase (					unittest.TestCase			):




       """simple docstring"""



       @slow
       def        _snake_case       (      self		)->Any:




         '''simple docstring'''





         A_      :				Any		     =					TFDistilBertModel.from_pretrained('''distilbert-base-uncased'''		)
         A_      :				Union[str, Any]		     =					tf.constant([[0, 1, 2, 3, 4, 5]]		)
         A_      :				Optional[Any]		     =					model(_SCREAMING_SNAKE_CASE		)[0]

         A_      :				Optional[Any]		     =					[1, 6, 768]
         self.assertEqual(output.shape				,       _SCREAMING_SNAKE_CASE		)

         A_      :				List[str]		     =					tf.constant(
             [
                 [
                     [0.1_9_2_6_1_8_8_5, -0.1_3_7_3_2_9_5_5, 0.4_1_1_9_7_9_9],
                     [0.2_2_1_5_0_1_5_6, -0.0_7_4_2_2_6_6_1, 0.3_9_0_3_7_2_0_4],
                     [0.2_2_7_5_6_0_1_8, -0.0_8_9_6_4_1_4, 0.3_7_0_1_4_6_7],
                 ]
             ]		)
         tf.debugging.assert_near(output[:, :3, :3]				,       _SCREAMING_SNAKE_CASE				,       atol=1e-4		)











"""simple docstring"""





from __future__ import annotations

import unittest

from transformers import DistilBertConfig, is_tf_available
from transformers.testing_utils import require_tf, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
       import tensorflow as tf

       from transformers.models.distilbert.modeling_tf_distilbert import (
           TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
           TFDistilBertForMaskedLM,
           TFDistilBertForMultipleChoice,
           TFDistilBertForQuestionAnswering,
           TFDistilBertForSequenceClassification,
           TFDistilBertForTokenClassification,
           TFDistilBertModel,
       )

class 		lowercase					:





      def __init__(       self      ,						lowercase      ,						)		->     Optional[int]:
            lowerCAmelCase  						=       parent
            lowerCAmelCase  						=       13
            lowerCAmelCase  						=       7
            lowerCAmelCase  						=       True
            lowerCAmelCase  						=       True
            lowerCAmelCase  						=       False
            lowerCAmelCase  						=       True
            lowerCAmelCase  						=       99
            lowerCAmelCase  						=       32
            lowerCAmelCase  						=       2
            lowerCAmelCase  						=       4
            lowerCAmelCase  						=       37
            lowerCAmelCase  						=       """gelu"""
            lowerCAmelCase  						=       0.1
            lowerCAmelCase  						=       0.1
            lowerCAmelCase  						=       512
            lowerCAmelCase  						=       16
            lowerCAmelCase  						=       2
            lowerCAmelCase  						=       0.02
            lowerCAmelCase  						=       3
            lowerCAmelCase  						=       4
            lowerCAmelCase  						=       None





      def     _snake_case			(       self )		->     str:
            lowerCAmelCase  						=       ids_tensor([self.batch_size, self.seq_length]      ,						self.vocab_size )

            lowerCAmelCase  						=       None
            if self.use_input_mask:
                  lowerCAmelCase  						=       random_attention_mask([self.batch_size, self.seq_length] )

            lowerCAmelCase  						=       None
            lowerCAmelCase  						=       None
            lowerCAmelCase  						=       None
            if self.use_labels:
                  lowerCAmelCase  						=       ids_tensor([self.batch_size]      ,						self.type_sequence_label_size )
                  lowerCAmelCase  						=       ids_tensor([self.batch_size, self.seq_length]      ,						self.num_labels )
                  lowerCAmelCase  						=       ids_tensor([self.batch_size]      ,						self.num_choices )

            lowerCAmelCase  						=       DistilBertConfig(
                vocab_size=self.vocab_size      ,						dim=self.hidden_size      ,						n_layers=self.num_hidden_layers      ,						n_heads=self.num_attention_heads      ,						hidden_dim=self.intermediate_size      ,						hidden_act=self.hidden_act      ,						dropout=self.hidden_dropout_prob      ,						attention_dropout=self.attention_probs_dropout_prob      ,						max_position_embeddings=self.max_position_embeddings      ,						initializer_range=self.initializer_range      ,						)

            return config, input_ids, input_mask, sequence_labels, token_labels, choice_labels





      def     _snake_case			(       self      ,						lowercase      ,						lowercase      ,						lowercase      ,						lowercase      ,						lowercase      ,						lowercase )		->     List[Any]:
            lowerCAmelCase  						=       TFDistilBertModel(config=lowercase )
            lowerCAmelCase  						=       {"""input_ids""": input_ids, """attention_mask""": input_mask}

            lowerCAmelCase  						=       model(lowercase )

            lowerCAmelCase  						=       [input_ids, input_mask]

            lowerCAmelCase  						=       model(lowercase )

            self.parent.assertEqual(result.last_hidden_state.shape      ,						(self.batch_size, self.seq_length, self.hidden_size) )





      def     _snake_case			(       self      ,						lowercase      ,						lowercase      ,						lowercase      ,						lowercase      ,						lowercase      ,						lowercase )		->     Optional[int]:
            lowerCAmelCase  						=       TFDistilBertForMaskedLM(config=lowercase )
            lowerCAmelCase  						=       {"""input_ids""": input_ids, """attention_mask""": input_mask}
            lowerCAmelCase  						=       model(lowercase )
            self.parent.assertEqual(result.logits.shape      ,						(self.batch_size, self.seq_length, self.vocab_size) )





      def     _snake_case			(       self      ,						lowercase      ,						lowercase      ,						lowercase      ,						lowercase      ,						lowercase      ,						lowercase )		->     List[Any]:
            lowerCAmelCase  						=       TFDistilBertForQuestionAnswering(config=lowercase )
            lowerCAmelCase  						=       {
                """input_ids""": input_ids,
                """attention_mask""": input_mask,
            }
            lowerCAmelCase  						=       model(lowercase )
            self.parent.assertEqual(result.start_logits.shape      ,						(self.batch_size, self.seq_length) )
            self.parent.assertEqual(result.end_logits.shape      ,						(self.batch_size, self.seq_length) )





      def     _snake_case			(       self      ,						lowercase      ,						lowercase      ,						lowercase      ,						lowercase      ,						lowercase      ,						lowercase )		->     List[Any]:
            lowerCAmelCase  						=       self.num_labels
            lowerCAmelCase  						=       TFDistilBertForSequenceClassification(lowercase )
            lowerCAmelCase  						=       {"""input_ids""": input_ids, """attention_mask""": input_mask}
            lowerCAmelCase  						=       model(lowercase )
            self.parent.assertEqual(result.logits.shape      ,						(self.batch_size, self.num_labels) )





      def     _snake_case			(       self      ,						lowercase      ,						lowercase      ,						lowercase      ,						lowercase      ,						lowercase      ,						lowercase )		->     Any:
            lowerCAmelCase  						=       self.num_choices
            lowerCAmelCase  						=       TFDistilBertForMultipleChoice(lowercase )
            lowerCAmelCase  						=       tf.tile(tf.expand_dims(lowercase      ,						1 )      ,						(1, self.num_choices, 1) )
            lowerCAmelCase  						=       tf.tile(tf.expand_dims(lowercase      ,						1 )      ,						(1, self.num_choices, 1) )
            lowerCAmelCase  						=       {
                """input_ids""": multiple_choice_inputs_ids,
                """attention_mask""": multiple_choice_input_mask,
            }
            lowerCAmelCase  						=       model(lowercase )
            self.parent.assertEqual(result.logits.shape      ,						(self.batch_size, self.num_choices) )





      def     _snake_case			(       self      ,						lowercase      ,						lowercase      ,						lowercase      ,						lowercase      ,						lowercase      ,						lowercase )		->     int:
            lowerCAmelCase  						=       self.num_labels
            lowerCAmelCase  						=       TFDistilBertForTokenClassification(lowercase )
            lowerCAmelCase  						=       {"""input_ids""": input_ids, """attention_mask""": input_mask}
            lowerCAmelCase  						=       model(lowercase )
            self.parent.assertEqual(result.logits.shape      ,						(self.batch_size, self.seq_length, self.num_labels) )





      def     _snake_case			(       self )		->     Optional[Any]:
            lowerCAmelCase  						=       self.prepare_config_and_inputs()
            ((lowerCAmelCase)						,		(lowerCAmelCase)						,		(lowerCAmelCase)						,		(lowerCAmelCase)						,		(lowerCAmelCase)						,		(lowerCAmelCase))  						=       config_and_inputs
            lowerCAmelCase  						=       {"""input_ids""": input_ids, """attention_mask""": input_mask}
            return config, inputs_dict







@require_tf
class 		lowercase					(					_UpperCAmelCase     ,  _UpperCAmelCase     ,  unittest.TestCase					):
      _SCREAMING_SNAKE_CASE					=      (
          (
              TFDistilBertModel,
              TFDistilBertForMaskedLM,
              TFDistilBertForQuestionAnswering,
              TFDistilBertForSequenceClassification,
              TFDistilBertForTokenClassification,
              TFDistilBertForMultipleChoice,
          )
          if is_tf_available()
          else None
      )
      _SCREAMING_SNAKE_CASE					=      (
          {
              'feature-extraction': TFDistilBertModel,
              'fill-mask': TFDistilBertForMaskedLM,
              'question-answering': TFDistilBertForQuestionAnswering,
              'text-classification': TFDistilBertForSequenceClassification,
              'token-classification': TFDistilBertForTokenClassification,
              'zero-shot': TFDistilBertForSequenceClassification,
          }
          if is_tf_available()
          else {}
      )
      _SCREAMING_SNAKE_CASE					=      False
      _SCREAMING_SNAKE_CASE					=      False





      def     _snake_case			(       self )		->     Dict:
            lowerCAmelCase  						=       TFDistilBertModelTester(self )
            lowerCAmelCase  						=       ConfigTester(self      ,						config_class=lowercase      ,						dim=37 )





      def     _snake_case			(       self )		->     str:
            self.config_tester.run_common_tests()





      def     _snake_case			(       self )		->     int:
            lowerCAmelCase  						=       self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_distilbert_model(*lowercase )





      def     _snake_case			(       self )		->     Any:
            lowerCAmelCase  						=       self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_distilbert_for_masked_lm(*lowercase )





      def     _snake_case			(       self )		->     Optional[Any]:
            lowerCAmelCase  						=       self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_distilbert_for_question_answering(*lowercase )





      def     _snake_case			(       self )		->     Union[str, Any]:
            lowerCAmelCase  						=       self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_distilbert_for_sequence_classification(*lowercase )





      def     _snake_case			(       self )		->     List[Any]:
            lowerCAmelCase  						=       self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_distilbert_for_multiple_choice(*lowercase )





      def     _snake_case			(       self )		->     str:
            lowerCAmelCase  						=       self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_distilbert_for_token_classification(*lowercase )





      @slow
      def     _snake_case			(       self )		->     List[str]:
            for model_name in list(TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1] ):
                  lowerCAmelCase  						=       TFDistilBertModel.from_pretrained(lowercase )
                  self.assertIsNotNone(lowercase )







@require_tf
class 		lowercase					(					unittest.TestCase					):





      @slow
      def     _snake_case			(       self )		->     Any:
            lowerCAmelCase  						=       TFDistilBertModel.from_pretrained("""distilbert-base-uncased""" )
            lowerCAmelCase  						=       tf.constant([[0, 1, 2, 3, 4, 5]] )
            lowerCAmelCase  						=       model(lowercase )[0]

            lowerCAmelCase  						=       [1, 6, 768]
            self.assertEqual(output.shape      ,						lowercase )

            lowerCAmelCase  						=       tf.constant(
                [
                    [
                        [0.19_261_885, -0.13_732_955, 0.4_119_799],
                        [0.22_150_156, -0.07_422_661, 0.39_037_204],
                        [0.22_756_018, -0.0_896_414, 0.3_701_467],
                    ]
                ] )
            tf.debugging.assert_near(output[:, :3, :3]      ,						lowercase      ,						atol=1e-4 )






