


import os
from datetime import datetime as dt

from github import Github


UpperCAmelCase   :    Optional[Any]     =		[
    "good first issue",
    "feature request",
    "wip",
]






def 	__lowerCamelCase						(							):





			'''simple docstring'''




			lowerCamelCase    		=  Github(os.environ["""GITHUB_TOKEN"""]      )
			lowerCamelCase    		=  g.get_repo("""huggingface/accelerate"""      )
			lowerCamelCase    		=  repo.get_issues(state="""open"""      )

			for issue in open_issues:
						lowerCamelCase    		=  sorted([comment for comment in issue.get_comments()]  ,							key=lambda lowerCamelCase__      : i.created_at  ,							reverse=__A      )
						lowerCamelCase    		=  comments[0] if len(__A      ) > 0 else None
						lowerCamelCase    		=  dt.utcnow()
						lowerCamelCase    		=  (current_time - issue.updated_at).days
						lowerCamelCase    		=  (current_time - issue.created_at).days
						if (
						    last_comment is not None
						    and last_comment.user.login == "github-actions[bot]"
						    and days_since_updated > 7
						    and days_since_creation >= 30
						    and not any(label.name.lower() in LABELS_TO_EXEMPT for label in issue.get_labels()      )
						):
									# Close issue since it has been 7 days of inactivity since bot mention.
									issue.edit(state="""closed"""      )
						elif (
						    days_since_updated > 23
						    and days_since_creation >= 30
						    and not any(label.name.lower() in LABELS_TO_EXEMPT for label in issue.get_labels()      )
						):
									# Add stale comment
									issue.create_comment(
									    """This issue has been automatically marked as stale because it has not had """
									    """recent activity. If you think this still needs to be addressed """
									    """please comment on this thread.\n\nPlease note that issues that do not follow the """
									    """[contributing guidelines](https://github.com/huggingface/accelerate/blob/main/CONTRIBUTING.md) """
									    """are likely to be ignored."""      )


if __name__ == "__main__":
		main()









'''simple docstring'''







from __future__ import annotations

import os
import tempfile
import unittest

from transformers import ConvBertConfig, 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 import (
		    TFConvBertForMaskedLM,
		    TFConvBertForMultipleChoice,
		    TFConvBertForQuestionAnswering,
		    TFConvBertForSequenceClassification,
		    TFConvBertForTokenClassification,
		    TFConvBertModel,
		)





class 						SCREAMING_SNAKE_CASE       :






			def __init__(			self   :      Union[str, Any]	,    __SCREAMING_SNAKE_CASE   :      Tuple	,    __SCREAMING_SNAKE_CASE   :      str=13	,    __SCREAMING_SNAKE_CASE   :      Optional[int]=7	,    __SCREAMING_SNAKE_CASE   :      List[str]=True	,    __SCREAMING_SNAKE_CASE   :      Optional[int]=True	,    __SCREAMING_SNAKE_CASE   :      Any=True	,    __SCREAMING_SNAKE_CASE   :      int=True	,    __SCREAMING_SNAKE_CASE   :      List[str]=99	,    __SCREAMING_SNAKE_CASE   :      Optional[int]=32	,    __SCREAMING_SNAKE_CASE   :      Tuple=2	,    __SCREAMING_SNAKE_CASE   :      str=4	,    __SCREAMING_SNAKE_CASE   :      int=37	,    __SCREAMING_SNAKE_CASE   :      Any="gelu"	,    __SCREAMING_SNAKE_CASE   :      List[Any]=0.1	,    __SCREAMING_SNAKE_CASE   :      List[Any]=0.1	,    __SCREAMING_SNAKE_CASE   :      Tuple=512	,    __SCREAMING_SNAKE_CASE   :      Optional[Any]=16	,    __SCREAMING_SNAKE_CASE   :      Dict=2	,    __SCREAMING_SNAKE_CASE   :      List[Any]=0.02	,    __SCREAMING_SNAKE_CASE   :      List[Any]=3	,    __SCREAMING_SNAKE_CASE   :      List[Any]=4	,    __SCREAMING_SNAKE_CASE   :      Dict=None	,    )      ->      Tuple:
							a_		:	Any									=   parent
							a_		:	List[str]									=   13
							a_		:	Dict									=   7
							a_		:	List[str]									=   True
							a_		:	str									=   True
							a_		:	List[str]									=   True
							a_		:	Any									=   True
							a_		:	List[Any]									=   99
							a_		:	Optional[Any]									=   384
							a_		:	List[str]									=   2
							a_		:	Optional[int]									=   4
							a_		:	Optional[int]									=   37
							a_		:	Union[str, Any]									=   '''gelu'''
							a_		:	List[str]									=   0.1
							a_		:	str									=   0.1
							a_		:	Optional[Any]									=   512
							a_		:	Union[str, Any]									=   16
							a_		:	Optional[Any]									=   2
							a_		:	Optional[int]									=   0.02
							a_		:	Union[str, Any]									=   3
							a_		:	Union[str, Any]									=   4
							a_		:	List[Any]									=   128
							a_		:	Optional[Any]									=   2
							a_		:	Any									=   9
							a_		:	Optional[int]									=   1
							a_		:	int									=   None






			def       SCREAMING_SNAKE_CASE   (			self   :      Dict       )      ->      Union[str, Any]:
							a_		:	Dict									=   ids_tensor([self.batch_size, self.seq_length]	,    self.vocab_size       )

							a_		:	int									=   None
							if self.use_input_mask:
											a_		:	Dict									=   random_attention_mask([self.batch_size, self.seq_length]       )

							a_		:	Optional[int]									=   None
							if self.use_token_type_ids:
											a_		:	Any									=   ids_tensor([self.batch_size, self.seq_length]	,    self.type_vocab_size       )

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

							a_		:	Union[str, Any]									=   ConvBertConfig(
							    vocab_size=self.vocab_size	,    hidden_size=self.hidden_size	,    num_hidden_layers=self.num_hidden_layers	,    num_attention_heads=self.num_attention_heads	,    intermediate_size=self.intermediate_size	,    hidden_act=self.hidden_act	,    hidden_dropout_prob=self.hidden_dropout_prob	,    attention_probs_dropout_prob=self.attention_probs_dropout_prob	,    max_position_embeddings=self.max_position_embeddings	,    type_vocab_size=self.type_vocab_size	,    initializer_range=self.initializer_range	,    return_dict=__SCREAMING_SNAKE_CASE	,    )

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






			def       SCREAMING_SNAKE_CASE   (			self   :      Optional[Any]	,    __SCREAMING_SNAKE_CASE   :      Any	,    __SCREAMING_SNAKE_CASE   :      Tuple	,    __SCREAMING_SNAKE_CASE   :      Any	,    __SCREAMING_SNAKE_CASE   :      Any	,    __SCREAMING_SNAKE_CASE   :      int	,    __SCREAMING_SNAKE_CASE   :      Any	,    __SCREAMING_SNAKE_CASE   :      Optional[Any]       )      ->      Union[str, Any]:
							a_		:	Tuple									=   TFConvBertModel(config=__SCREAMING_SNAKE_CASE       )
							a_		:	str									=   {'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}

							a_		:	Optional[Any]									=   [input_ids, input_mask]
							a_		:	Tuple									=   model(__SCREAMING_SNAKE_CASE       )

							a_		:	int									=   model(__SCREAMING_SNAKE_CASE       )

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






			def       SCREAMING_SNAKE_CASE   (			self   :      Optional[Any]	,    __SCREAMING_SNAKE_CASE   :      Tuple	,    __SCREAMING_SNAKE_CASE   :      Any	,    __SCREAMING_SNAKE_CASE   :      Any	,    __SCREAMING_SNAKE_CASE   :      List[str]	,    __SCREAMING_SNAKE_CASE   :      Tuple	,    __SCREAMING_SNAKE_CASE   :      Tuple	,    __SCREAMING_SNAKE_CASE   :      Dict       )      ->      str:
							a_		:	List[Any]									=   TFConvBertForMaskedLM(config=__SCREAMING_SNAKE_CASE       )
							a_		:	Dict									=   {
							    '''input_ids''': input_ids,
							    '''attention_mask''': input_mask,
							    '''token_type_ids''': token_type_ids,
							}
							a_		:	str									=   model(__SCREAMING_SNAKE_CASE       )
							self.parent.assertEqual(result.logits.shape	,    (self.batch_size, self.seq_length, self.vocab_size)       )






			def       SCREAMING_SNAKE_CASE   (			self   :      Optional[int]	,    __SCREAMING_SNAKE_CASE   :      str	,    __SCREAMING_SNAKE_CASE   :      int	,    __SCREAMING_SNAKE_CASE   :      str	,    __SCREAMING_SNAKE_CASE   :      List[str]	,    __SCREAMING_SNAKE_CASE   :      Dict	,    __SCREAMING_SNAKE_CASE   :      Tuple	,    __SCREAMING_SNAKE_CASE   :      int       )      ->      Any:
							a_		:	Union[str, Any]									=   self.num_labels
							a_		:	List[str]									=   TFConvBertForSequenceClassification(config=__SCREAMING_SNAKE_CASE       )
							a_		:	Optional[Any]									=   {
							    '''input_ids''': input_ids,
							    '''attention_mask''': input_mask,
							    '''token_type_ids''': token_type_ids,
							}

							a_		:	Tuple									=   model(__SCREAMING_SNAKE_CASE       )
							self.parent.assertEqual(result.logits.shape	,    (self.batch_size, self.num_labels)       )






			def       SCREAMING_SNAKE_CASE   (			self   :      List[Any]	,    __SCREAMING_SNAKE_CASE   :      List[str]	,    __SCREAMING_SNAKE_CASE   :      Optional[Any]	,    __SCREAMING_SNAKE_CASE   :      str	,    __SCREAMING_SNAKE_CASE   :      str	,    __SCREAMING_SNAKE_CASE   :      Dict	,    __SCREAMING_SNAKE_CASE   :      Tuple	,    __SCREAMING_SNAKE_CASE   :      Tuple       )      ->      Optional[int]:
							a_		:	Optional[Any]									=   self.num_choices
							a_		:	int									=   TFConvBertForMultipleChoice(config=__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_		:	List[Any]									=   tf.tile(tf.expand_dims(__SCREAMING_SNAKE_CASE	,    1       )	,    (1, self.num_choices, 1)       )
							a_		:	Union[str, Any]									=   {
							    '''input_ids''': multiple_choice_inputs_ids,
							    '''attention_mask''': multiple_choice_input_mask,
							    '''token_type_ids''': multiple_choice_token_type_ids,
							}
							a_		:	Optional[int]									=   model(__SCREAMING_SNAKE_CASE       )
							self.parent.assertEqual(result.logits.shape	,    (self.batch_size, self.num_choices)       )






			def       SCREAMING_SNAKE_CASE   (			self   :      List[Any]	,    __SCREAMING_SNAKE_CASE   :      List[str]	,    __SCREAMING_SNAKE_CASE   :      Dict	,    __SCREAMING_SNAKE_CASE   :      Optional[Any]	,    __SCREAMING_SNAKE_CASE   :      Union[str, Any]	,    __SCREAMING_SNAKE_CASE   :      Union[str, Any]	,    __SCREAMING_SNAKE_CASE   :      List[Any]	,    __SCREAMING_SNAKE_CASE   :      Tuple       )      ->      str:
							a_		:	Optional[Any]									=   self.num_labels
							a_		:	Optional[int]									=   TFConvBertForTokenClassification(config=__SCREAMING_SNAKE_CASE       )
							a_		:	Tuple									=   {
							    '''input_ids''': input_ids,
							    '''attention_mask''': input_mask,
							    '''token_type_ids''': token_type_ids,
							}
							a_		:	Tuple									=   model(__SCREAMING_SNAKE_CASE       )
							self.parent.assertEqual(result.logits.shape	,    (self.batch_size, self.seq_length, self.num_labels)       )






			def       SCREAMING_SNAKE_CASE   (			self   :      List[str]	,    __SCREAMING_SNAKE_CASE   :      Optional[Any]	,    __SCREAMING_SNAKE_CASE   :      List[Any]	,    __SCREAMING_SNAKE_CASE   :      List[Any]	,    __SCREAMING_SNAKE_CASE   :      str	,    __SCREAMING_SNAKE_CASE   :      Optional[int]	,    __SCREAMING_SNAKE_CASE   :      Tuple	,    __SCREAMING_SNAKE_CASE   :      Union[str, Any]       )      ->      Tuple:
							a_		:	List[Any]									=   TFConvBertForQuestionAnswering(config=__SCREAMING_SNAKE_CASE       )
							a_		:	Optional[Any]									=   {
							    '''input_ids''': input_ids,
							    '''attention_mask''': input_mask,
							    '''token_type_ids''': token_type_ids,
							}

							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       SCREAMING_SNAKE_CASE   (			self   :      List[str]       )      ->      Any:
							a_		:	List[Any]									=   self.prepare_config_and_inputs()
							(
							    (
							    a_
							)					,      (
							    a_
							)					,      (
							    a_
							)					,      (
							    a_
							)					,      (
							    a_
							)					,      (
							    a_
							)					,      (
							    a_
							)					,      
							)		:	List[Any]									=   config_and_inputs
							a_		:	Any									=   {'''input_ids''': input_ids, '''token_type_ids''': token_type_ids, '''attention_mask''': input_mask}
							return config, inputs_dict





@require_tf
class 						SCREAMING_SNAKE_CASE       (       SCREAMING_SNAKE_CASE_						, SCREAMING_SNAKE_CASE_						, unittest.TestCase							):
			snake_case__	=					(
			    (
			        TFConvBertModel,
			        TFConvBertForMaskedLM,
			        TFConvBertForQuestionAnswering,
			        TFConvBertForSequenceClassification,
			        TFConvBertForTokenClassification,
			        TFConvBertForMultipleChoice,
			    )
			    if is_tf_available()
			    else ()
			)
			snake_case__	=					(
			    {
			        "feature-extraction": TFConvBertModel,
			        "fill-mask": TFConvBertForMaskedLM,
			        "question-answering": TFConvBertForQuestionAnswering,
			        "text-classification": TFConvBertForSequenceClassification,
			        "token-classification": TFConvBertForTokenClassification,
			        "zero-shot": TFConvBertForSequenceClassification,
			    }
			    if is_tf_available()
			    else {}
			)
			snake_case__	=					False
			snake_case__	=					False
			snake_case__	=					False






			def       SCREAMING_SNAKE_CASE   (			self   :      List[str]       )      ->      List[Any]:
							a_		:	Optional[int]									=   TFConvBertModelTester(self       )
							a_		:	Any									=   ConfigTester(self	,    config_class=__SCREAMING_SNAKE_CASE	,    hidden_size=37       )






			def       SCREAMING_SNAKE_CASE   (			self   :      str       )      ->      Optional[Any]:
							self.config_tester.run_common_tests()






			def       SCREAMING_SNAKE_CASE   (			self   :      Tuple       )      ->      str:
							a_		:	Any									=   self.model_tester.prepare_config_and_inputs()
							self.model_tester.create_and_check_model(*__SCREAMING_SNAKE_CASE       )






			def       SCREAMING_SNAKE_CASE   (			self   :      Optional[Any]       )      ->      List[str]:
							a_		:	str									=   self.model_tester.prepare_config_and_inputs()
							self.model_tester.create_and_check_for_masked_lm(*__SCREAMING_SNAKE_CASE       )






			def       SCREAMING_SNAKE_CASE   (			self   :      Any       )      ->      str:
							a_		:	Dict									=   self.model_tester.prepare_config_and_inputs()
							self.model_tester.create_and_check_for_multiple_choice(*__SCREAMING_SNAKE_CASE       )






			def       SCREAMING_SNAKE_CASE   (			self   :      str       )      ->      Optional[Any]:
							a_		:	Optional[Any]									=   self.model_tester.prepare_config_and_inputs()
							self.model_tester.create_and_check_for_question_answering(*__SCREAMING_SNAKE_CASE       )






			def       SCREAMING_SNAKE_CASE   (			self   :      Any       )      ->      str:
							a_		:	List[str]									=   self.model_tester.prepare_config_and_inputs()
							self.model_tester.create_and_check_for_sequence_classification(*__SCREAMING_SNAKE_CASE       )






			def       SCREAMING_SNAKE_CASE   (			self   :      str       )      ->      Optional[int]:
							a_		:	Any									=   self.model_tester.prepare_config_and_inputs()
							self.model_tester.create_and_check_for_token_classification(*__SCREAMING_SNAKE_CASE       )






			@slow
			def       SCREAMING_SNAKE_CASE   (			self   :      Optional[int]       )      ->      Union[str, Any]:
							a_					,      a_		:	Optional[Any]									=   self.model_tester.prepare_config_and_inputs_for_common()
							a_		:	Any									=   True
							a_		:	Optional[int]									=   True

							if hasattr(__SCREAMING_SNAKE_CASE	,    '''use_cache'''       ):
											a_		:	Dict									=   True

							a_		:	Any									=   getattr(self.model_tester	,    '''encoder_seq_length'''	,    self.model_tester.seq_length       )
							a_		:	List[Any]									=   getattr(self.model_tester	,    '''key_length'''	,    __SCREAMING_SNAKE_CASE       )

							for model_class in self.all_model_classes:
											a_		:	str									=   self._prepare_for_class(__SCREAMING_SNAKE_CASE	,    __SCREAMING_SNAKE_CASE       )
											a_		:	Optional[int]									=   model_class(__SCREAMING_SNAKE_CASE       )
											a_		:	Any									=   len(model(__SCREAMING_SNAKE_CASE       )       )

											with tempfile.TemporaryDirectory() as tmpdirname:
															model.save_pretrained(__SCREAMING_SNAKE_CASE	,    saved_model=__SCREAMING_SNAKE_CASE       )
															a_		:	Union[str, Any]									=   os.path.join(__SCREAMING_SNAKE_CASE	,    '''saved_model'''	,    '''1'''       )
															a_		:	Optional[int]									=   tf.keras.models.load_model(__SCREAMING_SNAKE_CASE       )
															a_		:	Any									=   model(__SCREAMING_SNAKE_CASE       )

															if self.is_encoder_decoder:
																			a_		:	Optional[int]									=   outputs['''encoder_hidden_states''']
																			a_		:	Dict									=   outputs['''encoder_attentions''']
															else:
																			a_		:	Union[str, Any]									=   outputs['''hidden_states''']
																			a_		:	Tuple									=   outputs['''attentions''']

															self.assertEqual(len(__SCREAMING_SNAKE_CASE       )	,    __SCREAMING_SNAKE_CASE       )

															a_		:	Union[str, Any]									=   getattr(
															    self.model_tester	,    '''expected_num_hidden_layers'''	,    self.model_tester.num_hidden_layers + 1       )

															self.assertEqual(len(__SCREAMING_SNAKE_CASE       )	,    __SCREAMING_SNAKE_CASE       )
															self.assertListEqual(
															    list(output_hidden_states[0].shape[-2:]       )	,    [self.model_tester.seq_length, self.model_tester.hidden_size]	,    )

															self.assertEqual(len(__SCREAMING_SNAKE_CASE       )	,    self.model_tester.num_hidden_layers       )
															self.assertListEqual(
															    list(output_attentions[0].shape[-3:]       )	,    [self.model_tester.num_attention_heads / 2, encoder_seq_length, encoder_key_length]	,    )






			@slow
			def       SCREAMING_SNAKE_CASE   (			self   :      str       )      ->      Optional[int]:
							a_		:	Tuple									=   TFConvBertModel.from_pretrained('''YituTech/conv-bert-base'''       )
							self.assertIsNotNone(__SCREAMING_SNAKE_CASE       )







			def       SCREAMING_SNAKE_CASE   (			self   :      Any       )      ->      List[Any]:
							a_					,      a_		:	Union[str, Any]									=   self.model_tester.prepare_config_and_inputs_for_common()
							a_		:	Optional[Any]									=   True
							a_		:	Dict									=   getattr(self.model_tester	,    '''decoder_seq_length'''	,    self.model_tester.seq_length       )
							a_		:	List[str]									=   getattr(self.model_tester	,    '''encoder_seq_length'''	,    self.model_tester.seq_length       )
							a_		:	Dict									=   getattr(self.model_tester	,    '''key_length'''	,    __SCREAMING_SNAKE_CASE       )
							a_		:	Any									=   getattr(self.model_tester	,    '''key_length'''	,    __SCREAMING_SNAKE_CASE       )

							def check_decoder_attentions_output(__SCREAMING_SNAKE_CASE   :      List[str]       ):
											a_		:	int									=   len(__SCREAMING_SNAKE_CASE       )
											self.assertEqual(out_len % 2	,    0       )
											a_		:	Dict									=   outputs.decoder_attentions
											self.assertEqual(len(__SCREAMING_SNAKE_CASE       )	,    self.model_tester.num_hidden_layers       )
											self.assertListEqual(
											    list(decoder_attentions[0].shape[-3:]       )	,    [self.model_tester.num_attention_heads / 2, decoder_seq_length, decoder_key_length]	,    )

							def check_encoder_attentions_output(__SCREAMING_SNAKE_CASE   :      List[str]       ):
											a_		:	Optional[int]									=   [
											    t.numpy() for t in (outputs.encoder_attentions if config.is_encoder_decoder else outputs.attentions)
											]
											self.assertEqual(len(__SCREAMING_SNAKE_CASE       )	,    self.model_tester.num_hidden_layers       )
											self.assertListEqual(
											    list(attentions[0].shape[-3:]       )	,    [self.model_tester.num_attention_heads / 2, encoder_seq_length, encoder_key_length]	,    )

							for model_class in self.all_model_classes:
											a_		:	Tuple									=   True
											a_		:	Tuple									=   False
											a_		:	Optional[Any]									=   model_class(__SCREAMING_SNAKE_CASE       )
											a_		:	List[Any]									=   model(self._prepare_for_class(__SCREAMING_SNAKE_CASE	,    __SCREAMING_SNAKE_CASE       )       )
											a_		:	Union[str, Any]									=   len(__SCREAMING_SNAKE_CASE       )
											self.assertEqual(config.output_hidden_states	,    __SCREAMING_SNAKE_CASE       )
											check_encoder_attentions_output(__SCREAMING_SNAKE_CASE       )

											if self.is_encoder_decoder:
															a_		:	Any									=   model_class(__SCREAMING_SNAKE_CASE       )
															a_		:	List[Any]									=   model(self._prepare_for_class(__SCREAMING_SNAKE_CASE	,    __SCREAMING_SNAKE_CASE       )       )
															self.assertEqual(config.output_hidden_states	,    __SCREAMING_SNAKE_CASE       )
															check_decoder_attentions_output(__SCREAMING_SNAKE_CASE       )

											# Check that output attentions can also be changed via the config
											del inputs_dict["output_attentions"]
											a_		:	Union[str, Any]									=   True
											a_		:	Union[str, Any]									=   model_class(__SCREAMING_SNAKE_CASE       )
											a_		:	int									=   model(self._prepare_for_class(__SCREAMING_SNAKE_CASE	,    __SCREAMING_SNAKE_CASE       )       )
											self.assertEqual(config.output_hidden_states	,    __SCREAMING_SNAKE_CASE       )
											check_encoder_attentions_output(__SCREAMING_SNAKE_CASE       )

											# Check attention is always last and order is fine
											a_		:	Dict									=   True
											a_		:	str									=   True
											a_		:	int									=   model_class(__SCREAMING_SNAKE_CASE       )
											a_		:	List[Any]									=   model(self._prepare_for_class(__SCREAMING_SNAKE_CASE	,    __SCREAMING_SNAKE_CASE       )       )

											self.assertEqual(out_len + (2 if self.is_encoder_decoder else 1)	,    len(__SCREAMING_SNAKE_CASE       )       )
											self.assertEqual(model.config.output_hidden_states	,    __SCREAMING_SNAKE_CASE       )
											check_encoder_attentions_output(__SCREAMING_SNAKE_CASE       )





@require_tf
class 						SCREAMING_SNAKE_CASE       (       unittest.TestCase							):






			@slow
			def       SCREAMING_SNAKE_CASE   (			self   :      int       )      ->      Any:
							a_		:	int									=   TFConvBertModel.from_pretrained('''YituTech/conv-bert-base'''       )
							a_		:	List[Any]									=   tf.constant([[0, 1, 2, 3, 4, 5]]       )
							a_		:	Any									=   model(__SCREAMING_SNAKE_CASE       )[0]

							a_		:	str									=   [1, 6, 768]
							self.assertEqual(output.shape	,    __SCREAMING_SNAKE_CASE       )

							a_		:	Dict									=   tf.constant(
							    [
							        [
							            [-0.0347_5493, -0.468_6034, -0.3063_8832],
							            [0.2263_7248, -0.2698_8646, -0.742_3424],
							            [0.1032_4868, -0.4501_3508, -0.5828_0784],
							        ]
							    ]       )
							tf.debugging.assert_near(output[:, :3, :3]	,    __SCREAMING_SNAKE_CASE	,    atol=1e-4       )




