
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        SCREAMING_SNAKE_CASE__    :

							"""simple docstring"""






							def __init__(  self     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_=13     ,	SCREAMING_SNAKE_CASE_=7     ,	SCREAMING_SNAKE_CASE_=True     ,	SCREAMING_SNAKE_CASE_=True     ,	SCREAMING_SNAKE_CASE_=True     ,	SCREAMING_SNAKE_CASE_=True     ,	SCREAMING_SNAKE_CASE_=99     ,	SCREAMING_SNAKE_CASE_=[1, 1, 2]     ,	SCREAMING_SNAKE_CASE_=1     ,	SCREAMING_SNAKE_CASE_=32     ,	SCREAMING_SNAKE_CASE_=4     ,	SCREAMING_SNAKE_CASE_=8     ,	SCREAMING_SNAKE_CASE_=37     ,	SCREAMING_SNAKE_CASE_="gelu_new"     ,	SCREAMING_SNAKE_CASE_=0.1     ,	SCREAMING_SNAKE_CASE_=0.1     ,	SCREAMING_SNAKE_CASE_=0.0     ,	SCREAMING_SNAKE_CASE_=512     ,	SCREAMING_SNAKE_CASE_=3     ,	SCREAMING_SNAKE_CASE_=0.0_2     ,	SCREAMING_SNAKE_CASE_=3     ,	SCREAMING_SNAKE_CASE_=4     ,	SCREAMING_SNAKE_CASE_=None     ,	SCREAMING_SNAKE_CASE_=False     ,	)->   List[Any]:





													'''simple docstring'''






													__UpperCamelCase       =			parent
													__UpperCamelCase       =			batch_size
													__UpperCamelCase       =			seq_length
													__UpperCamelCase       =			is_training
													__UpperCamelCase       =			use_input_mask
													__UpperCamelCase       =			use_token_type_ids
													__UpperCamelCase       =			use_labels
													__UpperCamelCase       =			vocab_size
													__UpperCamelCase       =			block_sizes
													__UpperCamelCase       =			num_decoder_layers
													__UpperCamelCase       =			d_model
													__UpperCamelCase       =			n_head
													__UpperCamelCase       =			d_head
													__UpperCamelCase       =			d_inner
													__UpperCamelCase       =			hidden_act
													__UpperCamelCase       =			hidden_dropout
													__UpperCamelCase       =			attention_dropout
													__UpperCamelCase       =			activation_dropout
													__UpperCamelCase       =			max_position_embeddings
													__UpperCamelCase       =			type_vocab_size
													__UpperCamelCase       =			2
													__UpperCamelCase       =			num_labels
													__UpperCamelCase       =			num_choices
													__UpperCamelCase       =			scope
													__UpperCamelCase       =			initializer_std

													# Used in the tests to check the size of the first attention layer
													__UpperCamelCase       =			n_head
													# Used in the tests to check the size of the first hidden state
													__UpperCamelCase       =			self.d_model
													# Used in the tests to check the number of output hidden states/attentions
													__UpperCamelCase       =			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:
																			__UpperCamelCase       =			self.num_hidden_layers + 2



							def     A__		(  self			)->   str:





													'''simple docstring'''






													__UpperCamelCase       =			ids_tensor([self.batch_size, self.seq_length]     ,	self.vocab_size			)

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

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

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

													__UpperCamelCase       =			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     A__		(  self     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	)->   Optional[Any]:





													'''simple docstring'''






													__UpperCamelCase       =			TFFunnelModel(config=SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			{'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
													__UpperCamelCase       =			model(SCREAMING_SNAKE_CASE_			)

													__UpperCamelCase       =			[input_ids, input_mask]
													__UpperCamelCase       =			model(SCREAMING_SNAKE_CASE_			)

													__UpperCamelCase       =			model(SCREAMING_SNAKE_CASE_			)
													self.parent.assertEqual(result.last_hidden_state.shape     ,	(self.batch_size, self.seq_length, self.d_model)			)

													__UpperCamelCase       =			False
													__UpperCamelCase       =			TFFunnelModel(config=SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			model(SCREAMING_SNAKE_CASE_			)
													self.parent.assertEqual(result.last_hidden_state.shape     ,	(self.batch_size, self.seq_length, self.d_model)			)

													__UpperCamelCase       =			False
													__UpperCamelCase       =			TFFunnelModel(config=SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			model(SCREAMING_SNAKE_CASE_			)
													self.parent.assertEqual(result.last_hidden_state.shape     ,	(self.batch_size, self.seq_length, self.d_model)			)



							def     A__		(  self     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	)->   List[str]:





													'''simple docstring'''






													__UpperCamelCase       =			TFFunnelBaseModel(config=SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			{'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
													__UpperCamelCase       =			model(SCREAMING_SNAKE_CASE_			)

													__UpperCamelCase       =			[input_ids, input_mask]
													__UpperCamelCase       =			model(SCREAMING_SNAKE_CASE_			)

													__UpperCamelCase       =			model(SCREAMING_SNAKE_CASE_			)
													self.parent.assertEqual(result.last_hidden_state.shape     ,	(self.batch_size, 2, self.d_model)			)

													__UpperCamelCase       =			False
													__UpperCamelCase       =			TFFunnelBaseModel(config=SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			model(SCREAMING_SNAKE_CASE_			)
													self.parent.assertEqual(result.last_hidden_state.shape     ,	(self.batch_size, 3, self.d_model)			)

													__UpperCamelCase       =			False
													__UpperCamelCase       =			TFFunnelBaseModel(config=SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			model(SCREAMING_SNAKE_CASE_			)
													self.parent.assertEqual(result.last_hidden_state.shape     ,	(self.batch_size, 2, self.d_model)			)



							def     A__		(  self     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	)->   str:





													'''simple docstring'''






													__UpperCamelCase       =			TFFunnelForPreTraining(config=SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			{'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
													__UpperCamelCase       =			model(SCREAMING_SNAKE_CASE_			)
													self.parent.assertEqual(result.logits.shape     ,	(self.batch_size, self.seq_length)			)



							def     A__		(  self     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	)->   Optional[Any]:





													'''simple docstring'''






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



							def     A__		(  self     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	)->   int:





													'''simple docstring'''






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



							def     A__		(  self     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	)->   Optional[Any]:





													'''simple docstring'''






													__UpperCamelCase       =			self.num_choices
													__UpperCamelCase       =			TFFunnelForMultipleChoice(config=SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			tf.tile(tf.expand_dims(SCREAMING_SNAKE_CASE_     ,	1			)     ,	(1, self.num_choices, 1)			)
													__UpperCamelCase       =			tf.tile(tf.expand_dims(SCREAMING_SNAKE_CASE_     ,	1			)     ,	(1, self.num_choices, 1)			)
													__UpperCamelCase       =			tf.tile(tf.expand_dims(SCREAMING_SNAKE_CASE_     ,	1			)     ,	(1, self.num_choices, 1)			)
													__UpperCamelCase       =			{
													    '''input_ids''': multiple_choice_inputs_ids,
													    '''attention_mask''': multiple_choice_input_mask,
													    '''token_type_ids''': multiple_choice_token_type_ids,
													}
													__UpperCamelCase       =			model(SCREAMING_SNAKE_CASE_			)
													self.parent.assertEqual(result.logits.shape     ,	(self.batch_size, self.num_choices)			)



							def     A__		(  self     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	)->   Dict:





													'''simple docstring'''






													__UpperCamelCase       =			self.num_labels
													__UpperCamelCase       =			TFFunnelForTokenClassification(config=SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			{'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
													__UpperCamelCase       =			model(SCREAMING_SNAKE_CASE_			)
													self.parent.assertEqual(result.logits.shape     ,	(self.batch_size, self.seq_length, self.num_labels)			)



							def     A__		(  self     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	)->   str:





													'''simple docstring'''






													__UpperCamelCase       =			TFFunnelForQuestionAnswering(config=SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			{'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
													__UpperCamelCase       =			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     A__		(  self			)->   Any:





													'''simple docstring'''






													__UpperCamelCase       =			self.prepare_config_and_inputs()
													(
													    (
													    __UpperCamelCase							
													)  ,							(
													    __UpperCamelCase							
													)  ,							(
													    __UpperCamelCase							
													)  ,							(
													    __UpperCamelCase							
													)  ,							(
													    __UpperCamelCase							
													)  ,							(
													    __UpperCamelCase							
													)  ,							(
													    __UpperCamelCase							
													)  ,														
													)       =			config_and_inputs
													__UpperCamelCase       =			{'''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    ):

							"""simple docstring"""






							_snake_case     		=  (
							    (
							        TFFunnelModel,
							        TFFunnelForMaskedLM,
							        TFFunnelForPreTraining,
							        TFFunnelForQuestionAnswering,
							        TFFunnelForTokenClassification,
							    )
							    if is_tf_available()
							    else ()
							)
							_snake_case     		=  (
							    {
							        'feature-extraction': (TFFunnelBaseModel, TFFunnelModel),
							        'fill-mask': TFFunnelForMaskedLM,
							        'question-answering': TFFunnelForQuestionAnswering,
							        'text-classification': TFFunnelForSequenceClassification,
							        'token-classification': TFFunnelForTokenClassification,
							        'zero-shot': TFFunnelForSequenceClassification,
							    }
							    if is_tf_available()
							    else {}
							)
							_snake_case     		=  False
							_snake_case     		=  False



							def     A__		(  self			)->   Dict:





													'''simple docstring'''






													__UpperCamelCase       =			TFFunnelModelTester(self			)
													__UpperCamelCase       =			ConfigTester(self     ,	config_class=SCREAMING_SNAKE_CASE_			)



							def     A__		(  self			)->   Any:





													'''simple docstring'''






													self.config_tester.run_common_tests()



							def     A__		(  self			)->   int:





													'''simple docstring'''






													__UpperCamelCase       =			self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_model(*SCREAMING_SNAKE_CASE_			)



							def     A__		(  self			)->   Optional[int]:





													'''simple docstring'''






													__UpperCamelCase       =			self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_for_pretraining(*SCREAMING_SNAKE_CASE_			)



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





													'''simple docstring'''






													__UpperCamelCase       =			self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_for_masked_lm(*SCREAMING_SNAKE_CASE_			)



							def     A__		(  self			)->   List[str]:





													'''simple docstring'''






													__UpperCamelCase       =			self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_for_token_classification(*SCREAMING_SNAKE_CASE_			)



							def     A__		(  self			)->   str:





													'''simple docstring'''






													__UpperCamelCase       =			self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_for_question_answering(*SCREAMING_SNAKE_CASE_			)






@require_tf
class        SCREAMING_SNAKE_CASE__    (							SCREAMING_SNAKE_CASE_   ,		unittest.TestCase    ):

							"""simple docstring"""






							_snake_case     		=  (
							    (TFFunnelBaseModel, TFFunnelForMultipleChoice, TFFunnelForSequenceClassification) if is_tf_available() else ()
							)
							_snake_case     		=  False
							_snake_case     		=  False



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





													'''simple docstring'''






													__UpperCamelCase       =			TFFunnelModelTester(self     ,	base=SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			ConfigTester(self     ,	config_class=SCREAMING_SNAKE_CASE_			)



							def     A__		(  self			)->   int:





													'''simple docstring'''






													self.config_tester.run_common_tests()



							def     A__		(  self			)->   List[str]:





													'''simple docstring'''






													__UpperCamelCase       =			self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_base_model(*SCREAMING_SNAKE_CASE_			)



							def     A__		(  self			)->   Optional[int]:





													'''simple docstring'''






													__UpperCamelCase       =			self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_for_sequence_classification(*SCREAMING_SNAKE_CASE_			)



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





													'''simple docstring'''






													__UpperCamelCase       =			self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_for_multiple_choice(*SCREAMING_SNAKE_CASE_			)






from collections import OrderedDict
from typing import Mapping

from packaging import version

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


lowercase__							:							Tuple									=			logging.get_logger(__name__)

lowercase__							:							int									=			{
    "microsoft/table-transformer-detection": (
        "https://huggingface.co/microsoft/table-transformer-detection/resolve/main/config.json"
    ),
}






class        SCREAMING_SNAKE_CASE__    (							SCREAMING_SNAKE_CASE_    ):

							"""simple docstring"""






							_snake_case     		=  'table-transformer'
							_snake_case     		=  ['past_key_values']
							_snake_case     		=  {
							    'hidden_size': 'd_model',
							    'num_attention_heads': 'encoder_attention_heads',
							}



							def __init__(  self     ,	SCREAMING_SNAKE_CASE_=True     ,	SCREAMING_SNAKE_CASE_=None     ,	SCREAMING_SNAKE_CASE_=3     ,	SCREAMING_SNAKE_CASE_=100     ,	SCREAMING_SNAKE_CASE_=6     ,	SCREAMING_SNAKE_CASE_=2048     ,	SCREAMING_SNAKE_CASE_=8     ,	SCREAMING_SNAKE_CASE_=6     ,	SCREAMING_SNAKE_CASE_=2048     ,	SCREAMING_SNAKE_CASE_=8     ,	SCREAMING_SNAKE_CASE_=0.0     ,	SCREAMING_SNAKE_CASE_=0.0     ,	SCREAMING_SNAKE_CASE_=True     ,	SCREAMING_SNAKE_CASE_="relu"     ,	SCREAMING_SNAKE_CASE_=256     ,	SCREAMING_SNAKE_CASE_=0.1     ,	SCREAMING_SNAKE_CASE_=0.0     ,	SCREAMING_SNAKE_CASE_=0.0     ,	SCREAMING_SNAKE_CASE_=0.0_2     ,	SCREAMING_SNAKE_CASE_=1.0     ,	SCREAMING_SNAKE_CASE_=False     ,	SCREAMING_SNAKE_CASE_="sine"     ,	SCREAMING_SNAKE_CASE_="resnet50"     ,	SCREAMING_SNAKE_CASE_=True     ,	SCREAMING_SNAKE_CASE_=False     ,	SCREAMING_SNAKE_CASE_=1     ,	SCREAMING_SNAKE_CASE_=5     ,	SCREAMING_SNAKE_CASE_=2     ,	SCREAMING_SNAKE_CASE_=1     ,	SCREAMING_SNAKE_CASE_=1     ,	SCREAMING_SNAKE_CASE_=5     ,	SCREAMING_SNAKE_CASE_=2     ,	SCREAMING_SNAKE_CASE_=0.1     ,	**SCREAMING_SNAKE_CASE_     ,	)->   Tuple:





													'''simple docstring'''






													if backbone_config is not None and use_timm_backbone:
																			raise ValueError('''You can\'t specify both `backbone_config` and `use_timm_backbone`.'''			)

													if not use_timm_backbone:
																			if backbone_config is None:
																									logger.info('''`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone.'''			)
																									__UpperCamelCase       =			CONFIG_MAPPING['''resnet'''](out_features=['''stage4''']			)
																			elif isinstance(SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_			):
																									__UpperCamelCase       =			backbone_config.get('''model_type'''			)
																									__UpperCamelCase       =			CONFIG_MAPPING[backbone_model_type]
																									__UpperCamelCase       =			config_class.from_dict(SCREAMING_SNAKE_CASE_			)
																			# set timm attributes to None
																			__UpperCamelCase  ,							__UpperCamelCase  ,							__UpperCamelCase       =			None, None, None

													__UpperCamelCase       =			use_timm_backbone
													__UpperCamelCase       =			backbone_config
													__UpperCamelCase       =			num_channels
													__UpperCamelCase       =			num_queries
													__UpperCamelCase       =			d_model
													__UpperCamelCase       =			encoder_ffn_dim
													__UpperCamelCase       =			encoder_layers
													__UpperCamelCase       =			encoder_attention_heads
													__UpperCamelCase       =			decoder_ffn_dim
													__UpperCamelCase       =			decoder_layers
													__UpperCamelCase       =			decoder_attention_heads
													__UpperCamelCase       =			dropout
													__UpperCamelCase       =			attention_dropout
													__UpperCamelCase       =			activation_dropout
													__UpperCamelCase       =			activation_function
													__UpperCamelCase       =			init_std
													__UpperCamelCase       =			init_xavier_std
													__UpperCamelCase       =			encoder_layerdrop
													__UpperCamelCase       =			decoder_layerdrop
													__UpperCamelCase       =			encoder_layers
													__UpperCamelCase       =			auxiliary_loss
													__UpperCamelCase       =			position_embedding_type
													__UpperCamelCase       =			backbone
													__UpperCamelCase       =			use_pretrained_backbone
													__UpperCamelCase       =			dilation
													# Hungarian matcher
													__UpperCamelCase       =			class_cost
													__UpperCamelCase       =			bbox_cost
													__UpperCamelCase       =			giou_cost
													# Loss coefficients
													__UpperCamelCase       =			mask_loss_coefficient
													__UpperCamelCase       =			dice_loss_coefficient
													__UpperCamelCase       =			bbox_loss_coefficient
													__UpperCamelCase       =			giou_loss_coefficient
													__UpperCamelCase       =			eos_coefficient
													super().__init__(is_encoder_decoder=SCREAMING_SNAKE_CASE_     ,	**SCREAMING_SNAKE_CASE_			)



							@property
							def     A__		(  self			)->   int:





													'''simple docstring'''






													return self.encoder_attention_heads



							@property
							def     A__		(  self			)->   int:





													'''simple docstring'''






													return self.d_model






class        SCREAMING_SNAKE_CASE__    (							SCREAMING_SNAKE_CASE_    ):

							"""simple docstring"""






							_snake_case     		=  version.parse('1.11'    )



							@property
							def     A__		(  self			)->   Mapping[str, Mapping[int, str]]:





													'''simple docstring'''






													return OrderedDict(
													    [
													        ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
													        ('''pixel_mask''', {0: '''batch'''}),
													    ]			)



							@property
							def     A__		(  self			)->   float:





													'''simple docstring'''






													return 1E-5



							@property
							def     A__		(  self			)->   int:





													'''simple docstring'''






													return 12




