



import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING


_lowerCamelCase    :		Optional[Any]		      =    logging.get_logger(__name__)

_lowerCamelCase    :		int		      =    {
    """ut/deta""": """https://huggingface.co/ut/deta/resolve/main/config.json""",
}


class 						lowercase    (							SCREAMING_SNAKE_CASE_):
						'''simple docstring'''


						UpperCAmelCase			:		Union[str, Any]		=		'deta'
						UpperCAmelCase			:		Optional[int]		=		{
						    'hidden_size': 'd_model',
						    'num_attention_heads': 'encoder_attention_heads',
						}







						def __init__(  self    :				Optional[Any]       ,	snake_case    :				int=None       ,	snake_case    :				List[Any]=900       ,	snake_case    :				Any=2048       ,	snake_case    :				str=6       ,	snake_case    :				Tuple=2048       ,	snake_case    :				int=8       ,	snake_case    :				int=6       ,	snake_case    :				Optional[Any]=1024       ,	snake_case    :				str=8       ,	snake_case    :				int=0.0       ,	snake_case    :				int=True       ,	snake_case    :				int="relu"       ,	snake_case    :				int=256       ,	snake_case    :				Any=0.1       ,	snake_case    :				int=0.0       ,	snake_case    :				Dict=0.0       ,	snake_case    :				Dict=0.02       ,	snake_case    :				List[str]=1.0       ,	snake_case    :				Optional[int]=True       ,	snake_case    :				List[Any]=False       ,	snake_case    :				str="sine"       ,	snake_case    :				int=5       ,	snake_case    :				Tuple=4       ,	snake_case    :				int=4       ,	snake_case    :				Optional[Any]=True       ,	snake_case    :				Dict=300       ,	snake_case    :				Union[str, Any]=True       ,	snake_case    :				Union[str, Any]=True       ,	snake_case    :				str=1       ,	snake_case    :				Optional[int]=5       ,	snake_case    :				str=2       ,	snake_case    :				List[str]=1       ,	snake_case    :				int=1       ,	snake_case    :				Dict=5       ,	snake_case    :				Dict=2       ,	snake_case    :				Any=0.1       ,	snake_case    :				Any=0.25       ,	**snake_case    :				Optional[Any]       ,	):



											'''simple docstring'''


											if backbone_config is None:
																logger.info('`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone.'	)
																SCREAMING_SNAKE_CASE							:     str						=				CONFIG_MAPPING['resnet'](out_features=['stage2', 'stage3', 'stage4']	)
											else:
																if isinstance(snake_case       ,	snake_case	):
																					SCREAMING_SNAKE_CASE							:     Any						=				backbone_config.pop('model_type'	)
																					SCREAMING_SNAKE_CASE							:     Any						=				CONFIG_MAPPING[backbone_model_type]
																					SCREAMING_SNAKE_CASE							:     Dict						=				config_class.from_dict(snake_case	)

											SCREAMING_SNAKE_CASE							:     int						=				backbone_config
											SCREAMING_SNAKE_CASE							:     List[str]						=				num_queries
											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				max_position_embeddings
											SCREAMING_SNAKE_CASE							:     Any						=				d_model
											SCREAMING_SNAKE_CASE							:     List[str]						=				encoder_ffn_dim
											SCREAMING_SNAKE_CASE							:     Dict						=				encoder_layers
											SCREAMING_SNAKE_CASE							:     List[str]						=				encoder_attention_heads
											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				decoder_ffn_dim
											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				decoder_layers
											SCREAMING_SNAKE_CASE							:     List[str]						=				decoder_attention_heads
											SCREAMING_SNAKE_CASE							:     Dict						=				dropout
											SCREAMING_SNAKE_CASE							:     Optional[int]						=				attention_dropout
											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				activation_dropout
											SCREAMING_SNAKE_CASE							:     List[str]						=				activation_function
											SCREAMING_SNAKE_CASE							:     str						=				init_std
											SCREAMING_SNAKE_CASE							:     Any						=				init_xavier_std
											SCREAMING_SNAKE_CASE							:     List[Any]						=				encoder_layerdrop
											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				auxiliary_loss
											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				position_embedding_type
											# deformable attributes
											SCREAMING_SNAKE_CASE							:     Optional[int]						=				num_feature_levels
											SCREAMING_SNAKE_CASE							:     Any						=				encoder_n_points
											SCREAMING_SNAKE_CASE							:     Dict						=				decoder_n_points
											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				two_stage
											SCREAMING_SNAKE_CASE							:     Any						=				two_stage_num_proposals
											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				with_box_refine
											SCREAMING_SNAKE_CASE							:     Tuple						=				assign_first_stage
											if two_stage is True and with_box_refine is False:
																raise ValueError('If two_stage is True, with_box_refine must be True.'	)
											# Hungarian matcher
											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				class_cost
											SCREAMING_SNAKE_CASE							:     str						=				bbox_cost
											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				giou_cost
											# Loss coefficients
											SCREAMING_SNAKE_CASE							:     Tuple						=				mask_loss_coefficient
											SCREAMING_SNAKE_CASE							:     str						=				dice_loss_coefficient
											SCREAMING_SNAKE_CASE							:     Optional[int]						=				bbox_loss_coefficient
											SCREAMING_SNAKE_CASE							:     int						=				giou_loss_coefficient
											SCREAMING_SNAKE_CASE							:     str						=				eos_coefficient
											SCREAMING_SNAKE_CASE							:     List[str]						=				focal_alpha
											super().__init__(is_encoder_decoder=snake_case       ,	**snake_case	)







						@property
						def       lowerCamelCase_				(  self    :				str	):



											'''simple docstring'''


											return self.encoder_attention_heads







						@property
						def       lowerCamelCase_				(  self    :				Union[str, Any]	):



											'''simple docstring'''


											return self.d_model







						def       lowerCamelCase_				(  self    :				int	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				copy.deepcopy(self.__dict__	)
											SCREAMING_SNAKE_CASE							:     int						=				self.backbone_config.to_dict()
											SCREAMING_SNAKE_CASE							:     int						=				self.__class__.model_type
											return output




from __future__ import annotations

import unittest

from transformers import FunnelConfig, is_tf_available
from transformers.testing_utils import require_tf

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 (
			    TFFunnelBaseModel,
			    TFFunnelForMaskedLM,
			    TFFunnelForMultipleChoice,
			    TFFunnelForPreTraining,
			    TFFunnelForQuestionAnswering,
			    TFFunnelForSequenceClassification,
			    TFFunnelForTokenClassification,
			    TFFunnelModel,
			)


class 						lowercase    :
						'''simple docstring'''


						def __init__(  self    :				List[Any]       ,	snake_case    :				Optional[Any]       ,	snake_case    :				int=13       ,	snake_case    :				int=7       ,	snake_case    :				Dict=True       ,	snake_case    :				Union[str, Any]=True       ,	snake_case    :				Union[str, Any]=True       ,	snake_case    :				List[Any]=True       ,	snake_case    :				Tuple=99       ,	snake_case    :				Any=[1, 1, 2]       ,	snake_case    :				Dict=1       ,	snake_case    :				Optional[int]=32       ,	snake_case    :				Union[str, Any]=4       ,	snake_case    :				Optional[Any]=8       ,	snake_case    :				Dict=37       ,	snake_case    :				int="gelu_new"       ,	snake_case    :				Optional[Any]=0.1       ,	snake_case    :				List[str]=0.1       ,	snake_case    :				Any=0.0       ,	snake_case    :				Dict=512       ,	snake_case    :				List[str]=3       ,	snake_case    :				Any=0.02       ,	snake_case    :				List[str]=3       ,	snake_case    :				Optional[Any]=4       ,	snake_case    :				Dict=None       ,	snake_case    :				Any=False       ,	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				parent
											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				batch_size
											SCREAMING_SNAKE_CASE							:     List[str]						=				seq_length
											SCREAMING_SNAKE_CASE							:     int						=				is_training
											SCREAMING_SNAKE_CASE							:     Any						=				use_input_mask
											SCREAMING_SNAKE_CASE							:     Tuple						=				use_token_type_ids
											SCREAMING_SNAKE_CASE							:     Dict						=				use_labels
											SCREAMING_SNAKE_CASE							:     Dict						=				vocab_size
											SCREAMING_SNAKE_CASE							:     Dict						=				block_sizes
											SCREAMING_SNAKE_CASE							:     Dict						=				num_decoder_layers
											SCREAMING_SNAKE_CASE							:     int						=				d_model
											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				n_head
											SCREAMING_SNAKE_CASE							:     Optional[int]						=				d_head
											SCREAMING_SNAKE_CASE							:     int						=				d_inner
											SCREAMING_SNAKE_CASE							:     List[Any]						=				hidden_act
											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				hidden_dropout
											SCREAMING_SNAKE_CASE							:     Any						=				attention_dropout
											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				activation_dropout
											SCREAMING_SNAKE_CASE							:     str						=				max_position_embeddings
											SCREAMING_SNAKE_CASE							:     int						=				type_vocab_size
											SCREAMING_SNAKE_CASE							:     str						=				2
											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				num_labels
											SCREAMING_SNAKE_CASE							:     Tuple						=				num_choices
											SCREAMING_SNAKE_CASE							:     str						=				scope
											SCREAMING_SNAKE_CASE							:     int						=				initializer_std

											# Used in the tests to check the size of the first attention layer
											SCREAMING_SNAKE_CASE							:     int						=				n_head
											# Used in the tests to check the size of the first hidden state
											SCREAMING_SNAKE_CASE							:     List[str]						=				self.d_model
											# Used in the tests to check the number of output hidden states/attentions
											SCREAMING_SNAKE_CASE							:     List[str]						=				sum(self.block_sizes	) + (0 if base else self.num_decoder_layers)
											# FunnelModel adds two hidden layers: input embeddings and the sum of the upsampled encoder hidden state with
											# the last hidden state of the first block (which is the first hidden state of the decoder).
											if not base:
																SCREAMING_SNAKE_CASE							:     Dict						=				self.num_hidden_layers + 2







						def       lowerCamelCase_				(  self    :				int	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Any						=				ids_tensor([self.batch_size, self.seq_length]       ,	self.vocab_size	)

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

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

											SCREAMING_SNAKE_CASE							:     Any						=				None
											SCREAMING_SNAKE_CASE							:     Dict						=				None
											SCREAMING_SNAKE_CASE							:     int						=				None
											if self.use_labels:
																SCREAMING_SNAKE_CASE							:     List[Any]						=				ids_tensor([self.batch_size]       ,	self.type_sequence_label_size	)
																SCREAMING_SNAKE_CASE							:     Any						=				ids_tensor([self.batch_size, self.seq_length]       ,	self.num_labels	)
																SCREAMING_SNAKE_CASE							:     Dict						=				ids_tensor([self.batch_size]       ,	self.num_choices	)

											SCREAMING_SNAKE_CASE							:     Dict						=				FunnelConfig(
											    vocab_size=self.vocab_size       ,	block_sizes=self.block_sizes       ,	num_decoder_layers=self.num_decoder_layers       ,	d_model=self.d_model       ,	n_head=self.n_head       ,	d_head=self.d_head       ,	d_inner=self.d_inner       ,	hidden_act=self.hidden_act       ,	hidden_dropout=self.hidden_dropout       ,	attention_dropout=self.attention_dropout       ,	activation_dropout=self.activation_dropout       ,	max_position_embeddings=self.max_position_embeddings       ,	type_vocab_size=self.type_vocab_size       ,	initializer_std=self.initializer_std       ,	)

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







						def       lowerCamelCase_				(  self    :				Dict       ,	snake_case    :				List[str]       ,	snake_case    :				Tuple       ,	snake_case    :				Union[str, Any]       ,	snake_case    :				Any       ,	snake_case    :				Dict       ,	snake_case    :				Any       ,	snake_case    :				Union[str, Any]       ,	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     List[str]						=				TFFunnelModel(config=snake_case	)
											SCREAMING_SNAKE_CASE							:     Dict						=				{'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				model(snake_case	)

											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				[input_ids, input_mask]
											SCREAMING_SNAKE_CASE							:     List[Any]						=				model(snake_case	)

											SCREAMING_SNAKE_CASE							:     int						=				model(snake_case	)
											self.parent.assertEqual(result.last_hidden_state.shape       ,	(self.batch_size, self.seq_length, self.d_model)	)

											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				False
											SCREAMING_SNAKE_CASE							:     Any						=				TFFunnelModel(config=snake_case	)
											SCREAMING_SNAKE_CASE							:     Dict						=				model(snake_case	)
											self.parent.assertEqual(result.last_hidden_state.shape       ,	(self.batch_size, self.seq_length, self.d_model)	)

											SCREAMING_SNAKE_CASE							:     Any						=				False
											SCREAMING_SNAKE_CASE							:     int						=				TFFunnelModel(config=snake_case	)
											SCREAMING_SNAKE_CASE							:     List[Any]						=				model(snake_case	)
											self.parent.assertEqual(result.last_hidden_state.shape       ,	(self.batch_size, self.seq_length, self.d_model)	)







						def       lowerCamelCase_				(  self    :				str       ,	snake_case    :				Any       ,	snake_case    :				Dict       ,	snake_case    :				Any       ,	snake_case    :				Optional[Any]       ,	snake_case    :				Tuple       ,	snake_case    :				Dict       ,	snake_case    :				Optional[Any]       ,	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     str						=				TFFunnelBaseModel(config=snake_case	)
											SCREAMING_SNAKE_CASE							:     List[str]						=				{'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				model(snake_case	)

											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				[input_ids, input_mask]
											SCREAMING_SNAKE_CASE							:     Tuple						=				model(snake_case	)

											SCREAMING_SNAKE_CASE							:     Any						=				model(snake_case	)
											self.parent.assertEqual(result.last_hidden_state.shape       ,	(self.batch_size, 2, self.d_model)	)

											SCREAMING_SNAKE_CASE							:     Optional[int]						=				False
											SCREAMING_SNAKE_CASE							:     int						=				TFFunnelBaseModel(config=snake_case	)
											SCREAMING_SNAKE_CASE							:     Any						=				model(snake_case	)
											self.parent.assertEqual(result.last_hidden_state.shape       ,	(self.batch_size, 3, self.d_model)	)

											SCREAMING_SNAKE_CASE							:     int						=				False
											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				TFFunnelBaseModel(config=snake_case	)
											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				model(snake_case	)
											self.parent.assertEqual(result.last_hidden_state.shape       ,	(self.batch_size, 2, self.d_model)	)







						def       lowerCamelCase_				(  self    :				Optional[int]       ,	snake_case    :				Any       ,	snake_case    :				str       ,	snake_case    :				Optional[int]       ,	snake_case    :				List[str]       ,	snake_case    :				Union[str, Any]       ,	snake_case    :				List[Any]       ,	snake_case    :				Dict       ,	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Any						=				TFFunnelForPreTraining(config=snake_case	)
											SCREAMING_SNAKE_CASE							:     str						=				{'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
											SCREAMING_SNAKE_CASE							:     List[str]						=				model(snake_case	)
											self.parent.assertEqual(result.logits.shape       ,	(self.batch_size, self.seq_length)	)







						def       lowerCamelCase_				(  self    :				List[str]       ,	snake_case    :				Any       ,	snake_case    :				int       ,	snake_case    :				List[str]       ,	snake_case    :				Tuple       ,	snake_case    :				int       ,	snake_case    :				str       ,	snake_case    :				List[Any]       ,	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Dict						=				TFFunnelForMaskedLM(config=snake_case	)
											SCREAMING_SNAKE_CASE							:     Tuple						=				{'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
											SCREAMING_SNAKE_CASE							:     Tuple						=				model(snake_case	)
											self.parent.assertEqual(result.logits.shape       ,	(self.batch_size, self.seq_length, self.vocab_size)	)







						def       lowerCamelCase_				(  self    :				Any       ,	snake_case    :				Optional[Any]       ,	snake_case    :				Optional[int]       ,	snake_case    :				Dict       ,	snake_case    :				Optional[Any]       ,	snake_case    :				Dict       ,	snake_case    :				Tuple       ,	snake_case    :				str       ,	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Tuple						=				self.num_labels
											SCREAMING_SNAKE_CASE							:     Any						=				TFFunnelForSequenceClassification(config=snake_case	)
											SCREAMING_SNAKE_CASE							:     Tuple						=				{'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
											SCREAMING_SNAKE_CASE							:     Tuple						=				model(snake_case	)
											self.parent.assertEqual(result.logits.shape       ,	(self.batch_size, self.num_labels)	)







						def       lowerCamelCase_				(  self    :				Optional[Any]       ,	snake_case    :				List[Any]       ,	snake_case    :				Optional[Any]       ,	snake_case    :				Any       ,	snake_case    :				Dict       ,	snake_case    :				Dict       ,	snake_case    :				int       ,	snake_case    :				Tuple       ,	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Dict						=				self.num_choices
											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				TFFunnelForMultipleChoice(config=snake_case	)
											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				tf.tile(tf.expand_dims(snake_case       ,	1	)       ,	(1, self.num_choices, 1)	)
											SCREAMING_SNAKE_CASE							:     Tuple						=				tf.tile(tf.expand_dims(snake_case       ,	1	)       ,	(1, self.num_choices, 1)	)
											SCREAMING_SNAKE_CASE							:     Tuple						=				tf.tile(tf.expand_dims(snake_case       ,	1	)       ,	(1, self.num_choices, 1)	)
											SCREAMING_SNAKE_CASE							:     Optional[int]						=				{
											    'input_ids': multiple_choice_inputs_ids,
											    'attention_mask': multiple_choice_input_mask,
											    'token_type_ids': multiple_choice_token_type_ids,
											}
											SCREAMING_SNAKE_CASE							:     List[str]						=				model(snake_case	)
											self.parent.assertEqual(result.logits.shape       ,	(self.batch_size, self.num_choices)	)







						def       lowerCamelCase_				(  self    :				Any       ,	snake_case    :				Optional[Any]       ,	snake_case    :				Dict       ,	snake_case    :				Any       ,	snake_case    :				int       ,	snake_case    :				Union[str, Any]       ,	snake_case    :				Any       ,	snake_case    :				Optional[Any]       ,	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     int						=				self.num_labels
											SCREAMING_SNAKE_CASE							:     List[Any]						=				TFFunnelForTokenClassification(config=snake_case	)
											SCREAMING_SNAKE_CASE							:     Optional[int]						=				{'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
											SCREAMING_SNAKE_CASE							:     Tuple						=				model(snake_case	)
											self.parent.assertEqual(result.logits.shape       ,	(self.batch_size, self.seq_length, self.num_labels)	)







						def       lowerCamelCase_				(  self    :				str       ,	snake_case    :				Optional[Any]       ,	snake_case    :				Any       ,	snake_case    :				Dict       ,	snake_case    :				Any       ,	snake_case    :				Union[str, Any]       ,	snake_case    :				List[Any]       ,	snake_case    :				Dict       ,	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Tuple						=				TFFunnelForQuestionAnswering(config=snake_case	)
											SCREAMING_SNAKE_CASE							:     List[str]						=				{'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
											SCREAMING_SNAKE_CASE							:     Dict						=				model(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       lowerCamelCase_				(  self    :				Optional[Any]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				self.prepare_config_and_inputs()
											(
											    (
											    SCREAMING_SNAKE_CASE
											)					,  (
											    SCREAMING_SNAKE_CASE
											)					,  (
											    SCREAMING_SNAKE_CASE
											)					,  (
											    SCREAMING_SNAKE_CASE
											)					,  (
											    SCREAMING_SNAKE_CASE
											)					,  (
											    SCREAMING_SNAKE_CASE
											)					,  (
											    SCREAMING_SNAKE_CASE
											)					,  
											)							:     Any						=				config_and_inputs
											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				{'input_ids': input_ids, 'token_type_ids': token_type_ids, 'attention_mask': input_mask}
											return config, inputs_dict


@require_tf
class 						lowercase    (							SCREAMING_SNAKE_CASE_      ,    SCREAMING_SNAKE_CASE_      ,    unittest.TestCase):
						'''simple docstring'''


						UpperCAmelCase			:		int		=		(
						    (
						        TFFunnelModel,
						        TFFunnelForMaskedLM,
						        TFFunnelForPreTraining,
						        TFFunnelForQuestionAnswering,
						        TFFunnelForTokenClassification,
						    )
						    if is_tf_available()
						    else ()
						)
						UpperCAmelCase			:		Optional[Any]		=		(
						    {
						        'feature-extraction': (TFFunnelBaseModel, TFFunnelModel),
						        'fill-mask': TFFunnelForMaskedLM,
						        'question-answering': TFFunnelForQuestionAnswering,
						        'text-classification': TFFunnelForSequenceClassification,
						        'token-classification': TFFunnelForTokenClassification,
						        'zero-shot': TFFunnelForSequenceClassification,
						    }
						    if is_tf_available()
						    else {}
						)
						UpperCAmelCase			:		Any		=		False
						UpperCAmelCase			:		Tuple		=		False







						def       lowerCamelCase_				(  self    :				str	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     int						=				TFFunnelModelTester(self	)
											SCREAMING_SNAKE_CASE							:     Any						=				ConfigTester(self       ,	config_class=snake_case	)







						def       lowerCamelCase_				(  self    :				Any	):



											'''simple docstring'''


											self.config_tester.run_common_tests()







						def       lowerCamelCase_				(  self    :				Any	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_model(*snake_case	)







						def       lowerCamelCase_				(  self    :				str	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     str						=				self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_for_pretraining(*snake_case	)







						def       lowerCamelCase_				(  self    :				List[Any]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Tuple						=				self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_for_masked_lm(*snake_case	)







						def       lowerCamelCase_				(  self    :				Union[str, Any]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_for_token_classification(*snake_case	)







						def       lowerCamelCase_				(  self    :				List[Any]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     int						=				self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_for_question_answering(*snake_case	)


@require_tf
class 						lowercase    (							SCREAMING_SNAKE_CASE_      ,    unittest.TestCase):
						'''simple docstring'''


						UpperCAmelCase			:		Any		=		(
						    (TFFunnelBaseModel, TFFunnelForMultipleChoice, TFFunnelForSequenceClassification) if is_tf_available() else ()
						)
						UpperCAmelCase			:		List[str]		=		False
						UpperCAmelCase			:		Tuple		=		False







						def       lowerCamelCase_				(  self    :				Optional[Any]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				TFFunnelModelTester(self       ,	base=snake_case	)
											SCREAMING_SNAKE_CASE							:     Optional[int]						=				ConfigTester(self       ,	config_class=snake_case	)







						def       lowerCamelCase_				(  self    :				int	):



											'''simple docstring'''


											self.config_tester.run_common_tests()







						def       lowerCamelCase_				(  self    :				int	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     str						=				self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_base_model(*snake_case	)







						def       lowerCamelCase_				(  self    :				Dict	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     str						=				self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_for_sequence_classification(*snake_case	)







						def       lowerCamelCase_				(  self    :				int	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_for_multiple_choice(*snake_case	)