




"""simple docstring"""





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


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


						"""simple docstring"""




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

						# Used in the tests to check the size of the first attention layer
						__UpperCAmelCase	: List[str]		=					n_head
						# Used in the tests to check the size of the first hidden state
						__UpperCAmelCase	: int		=					self.d_model
						# Used in the tests to check the number of output hidden states/attentions
						__UpperCAmelCase	: Optional[Any]		=					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	: Dict		=					self.num_hidden_layers + 2


			def       a_     (      self      :    int):


						"""simple docstring"""




						__UpperCAmelCase	: Union[str, Any]		=					ids_tensor([self.batch_size, self.seq_length]      ,  self.vocab_size)

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

						__UpperCAmelCase	: int		=					None
						if self.use_token_type_ids:
									__UpperCAmelCase	: Union[str, Any]		=					ids_tensor([self.batch_size, self.seq_length]      ,  self.type_vocab_size)

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

						__UpperCAmelCase	: Tuple		=					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      :    List[Any]      ,  UpperCamelCase_      :    int      ,  UpperCamelCase_      :    Tuple      ,  UpperCamelCase_      :    Dict      ,  UpperCamelCase_      :    Tuple      ,  UpperCamelCase_      :    Union[str, Any]      ,  UpperCamelCase_      :    Any      ,  UpperCamelCase_      :    Union[str, Any]      ,  ):


						"""simple docstring"""




						__UpperCAmelCase	: List[str]		=					TFFunnelModel(config=UpperCamelCase_)
						__UpperCAmelCase	: Any		=					{"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
						__UpperCAmelCase	: Optional[Any]		=					model(UpperCamelCase_)

						__UpperCAmelCase	: str		=					[input_ids, input_mask]
						__UpperCAmelCase	: Any		=					model(UpperCamelCase_)

						__UpperCAmelCase	: Optional[Any]		=					model(UpperCamelCase_)
						self.parent.assertEqual(result.last_hidden_state.shape      ,  (self.batch_size, self.seq_length, self.d_model))

						__UpperCAmelCase	: Optional[Any]		=					False
						__UpperCAmelCase	: Dict		=					TFFunnelModel(config=UpperCamelCase_)
						__UpperCAmelCase	: List[Any]		=					model(UpperCamelCase_)
						self.parent.assertEqual(result.last_hidden_state.shape      ,  (self.batch_size, self.seq_length, self.d_model))

						__UpperCAmelCase	: str		=					False
						__UpperCAmelCase	: int		=					TFFunnelModel(config=UpperCamelCase_)
						__UpperCAmelCase	: Optional[int]		=					model(UpperCamelCase_)
						self.parent.assertEqual(result.last_hidden_state.shape      ,  (self.batch_size, self.seq_length, self.d_model))


			def       a_     (      self      :    str      ,  UpperCamelCase_      :    str      ,  UpperCamelCase_      :    List[str]      ,  UpperCamelCase_      :    int      ,  UpperCamelCase_      :    int      ,  UpperCamelCase_      :    Optional[int]      ,  UpperCamelCase_      :    Dict      ,  UpperCamelCase_      :    Any      ,  ):


						"""simple docstring"""




						__UpperCAmelCase	: Optional[Any]		=					TFFunnelBaseModel(config=UpperCamelCase_)
						__UpperCAmelCase	: List[str]		=					{"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
						__UpperCAmelCase	: str		=					model(UpperCamelCase_)

						__UpperCAmelCase	: Union[str, Any]		=					[input_ids, input_mask]
						__UpperCAmelCase	: int		=					model(UpperCamelCase_)

						__UpperCAmelCase	: Union[str, Any]		=					model(UpperCamelCase_)
						self.parent.assertEqual(result.last_hidden_state.shape      ,  (self.batch_size, 2, self.d_model))

						__UpperCAmelCase	: Dict		=					False
						__UpperCAmelCase	: List[Any]		=					TFFunnelBaseModel(config=UpperCamelCase_)
						__UpperCAmelCase	: Union[str, Any]		=					model(UpperCamelCase_)
						self.parent.assertEqual(result.last_hidden_state.shape      ,  (self.batch_size, 3, self.d_model))

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


			def       a_     (      self      :    Tuple      ,  UpperCamelCase_      :    Union[str, Any]      ,  UpperCamelCase_      :    Optional[Any]      ,  UpperCamelCase_      :    Optional[Any]      ,  UpperCamelCase_      :    Optional[Any]      ,  UpperCamelCase_      :    int      ,  UpperCamelCase_      :    Any      ,  UpperCamelCase_      :    Optional[int]      ,  ):


						"""simple docstring"""




						__UpperCAmelCase	: int		=					TFFunnelForPreTraining(config=UpperCamelCase_)
						__UpperCAmelCase	: Optional[Any]		=					{"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
						__UpperCAmelCase	: Optional[Any]		=					model(UpperCamelCase_)
						self.parent.assertEqual(result.logits.shape      ,  (self.batch_size, self.seq_length))


			def       a_     (      self      :    Union[str, Any]      ,  UpperCamelCase_      :    Optional[int]      ,  UpperCamelCase_      :    List[Any]      ,  UpperCamelCase_      :    Optional[Any]      ,  UpperCamelCase_      :    str      ,  UpperCamelCase_      :    List[Any]      ,  UpperCamelCase_      :    Any      ,  UpperCamelCase_      :    Tuple      ,  ):


						"""simple docstring"""




						__UpperCAmelCase	: List[str]		=					TFFunnelForMaskedLM(config=UpperCamelCase_)
						__UpperCAmelCase	: List[str]		=					{"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
						__UpperCAmelCase	: Optional[Any]		=					model(UpperCamelCase_)
						self.parent.assertEqual(result.logits.shape      ,  (self.batch_size, self.seq_length, self.vocab_size))


			def       a_     (      self      :    List[str]      ,  UpperCamelCase_      :    Optional[Any]      ,  UpperCamelCase_      :    str      ,  UpperCamelCase_      :    Union[str, Any]      ,  UpperCamelCase_      :    Any      ,  UpperCamelCase_      :    Any      ,  UpperCamelCase_      :    Optional[int]      ,  UpperCamelCase_      :    Tuple      ,  ):


						"""simple docstring"""




						__UpperCAmelCase	: int		=					self.num_labels
						__UpperCAmelCase	: Optional[Any]		=					TFFunnelForSequenceClassification(config=UpperCamelCase_)
						__UpperCAmelCase	: Dict		=					{"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
						__UpperCAmelCase	: List[str]		=					model(UpperCamelCase_)
						self.parent.assertEqual(result.logits.shape      ,  (self.batch_size, self.num_labels))


			def       a_     (      self      :    Dict      ,  UpperCamelCase_      :    Tuple      ,  UpperCamelCase_      :    Tuple      ,  UpperCamelCase_      :    List[str]      ,  UpperCamelCase_      :    Union[str, Any]      ,  UpperCamelCase_      :    List[str]      ,  UpperCamelCase_      :    int      ,  UpperCamelCase_      :    Any      ,  ):


						"""simple docstring"""




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


			def       a_     (      self      :    Optional[Any]      ,  UpperCamelCase_      :    Union[str, Any]      ,  UpperCamelCase_      :    List[str]      ,  UpperCamelCase_      :    List[str]      ,  UpperCamelCase_      :    Optional[int]      ,  UpperCamelCase_      :    str      ,  UpperCamelCase_      :    Union[str, Any]      ,  UpperCamelCase_      :    Tuple      ,  ):


						"""simple docstring"""




						__UpperCAmelCase	: Union[str, Any]		=					self.num_labels
						__UpperCAmelCase	: Dict		=					TFFunnelForTokenClassification(config=UpperCamelCase_)
						__UpperCAmelCase	: List[Any]		=					{"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
						__UpperCAmelCase	: Dict		=					model(UpperCamelCase_)
						self.parent.assertEqual(result.logits.shape      ,  (self.batch_size, self.seq_length, self.num_labels))


			def       a_     (      self      :    Any      ,  UpperCamelCase_      :    List[str]      ,  UpperCamelCase_      :    List[str]      ,  UpperCamelCase_      :    Any      ,  UpperCamelCase_      :    Any      ,  UpperCamelCase_      :    List[str]      ,  UpperCamelCase_      :    List[Any]      ,  UpperCamelCase_      :    Any      ,  ):


						"""simple docstring"""




						__UpperCAmelCase	: Optional[int]		=					TFFunnelForQuestionAnswering(config=UpperCamelCase_)
						__UpperCAmelCase	: Any		=					{"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
						__UpperCAmelCase	: List[str]		=					model(UpperCamelCase_)
						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      :    Optional[int]):


						"""simple docstring"""




						__UpperCAmelCase	: int		=					self.prepare_config_and_inputs()
						(
						    __UpperCAmelCase     
						)	: Tuple		=					config_and_inputs
						__UpperCAmelCase	: str		=					{"input_ids": input_ids, "token_type_ids": token_type_ids, "attention_mask": input_mask}
						return config, inputs_dict






@require_tf
class      a__				(	__magic_name__							,    __magic_name__							,    unittest.TestCase):
			lowercase_    =	(
			    (
			        TFFunnelModel,
			        TFFunnelForMaskedLM,
			        TFFunnelForPreTraining,
			        TFFunnelForQuestionAnswering,
			        TFFunnelForTokenClassification,
			    )
			    if is_tf_available()
			    else ()
			)
			lowercase_    =	(
			    {
			        "feature-extraction": (TFFunnelBaseModel, TFFunnelModel),
			        "fill-mask": TFFunnelForMaskedLM,
			        "question-answering": TFFunnelForQuestionAnswering,
			        "text-classification": TFFunnelForSequenceClassification,
			        "token-classification": TFFunnelForTokenClassification,
			        "zero-shot": TFFunnelForSequenceClassification,
			    }
			    if is_tf_available()
			    else {}
			)
			lowercase_    =	False
			lowercase_    =	False


			def       a_     (      self      :    Tuple):


						"""simple docstring"""




						__UpperCAmelCase	: List[str]		=					TFFunnelModelTester(self)
						__UpperCAmelCase	: List[Any]		=					ConfigTester(self      ,  config_class=UpperCamelCase_)


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


						"""simple docstring"""




						self.config_tester.run_common_tests()


			def       a_     (      self      :    Optional[int]):


						"""simple docstring"""




						__UpperCAmelCase	: Any		=					self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_model(*UpperCamelCase_)


			def       a_     (      self      :    str):


						"""simple docstring"""




						__UpperCAmelCase	: int		=					self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_for_pretraining(*UpperCamelCase_)


			def       a_     (      self      :    Dict):


						"""simple docstring"""




						__UpperCAmelCase	: Optional[Any]		=					self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_for_masked_lm(*UpperCamelCase_)


			def       a_     (      self      :    str):


						"""simple docstring"""




						__UpperCAmelCase	: List[Any]		=					self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_for_token_classification(*UpperCamelCase_)


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


						"""simple docstring"""




						__UpperCAmelCase	: Dict		=					self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_for_question_answering(*UpperCamelCase_)






@require_tf
class      a__				(	__magic_name__							,    unittest.TestCase):
			lowercase_    =	(
			    (TFFunnelBaseModel, TFFunnelForMultipleChoice, TFFunnelForSequenceClassification) if is_tf_available() else ()
			)
			lowercase_    =	False
			lowercase_    =	False


			def       a_     (      self      :    Dict):


						"""simple docstring"""




						__UpperCAmelCase	: Optional[Any]		=					TFFunnelModelTester(self      ,  base=UpperCamelCase_)
						__UpperCAmelCase	: Any		=					ConfigTester(self      ,  config_class=UpperCamelCase_)


			def       a_     (      self      :    Optional[Any]):


						"""simple docstring"""




						self.config_tester.run_common_tests()


			def       a_     (      self      :    int):


						"""simple docstring"""




						__UpperCAmelCase	: Dict		=					self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_base_model(*UpperCamelCase_)


			def       a_     (      self      :    str):


						"""simple docstring"""




						__UpperCAmelCase	: Union[str, Any]		=					self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_for_sequence_classification(*UpperCamelCase_)


			def       a_     (      self      :    Tuple):


						"""simple docstring"""




						__UpperCAmelCase	: Optional[Any]		=					self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_for_multiple_choice(*UpperCamelCase_)








"""simple docstring"""





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


A   =       logging.get_logger(__name__)

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



class      a__				(	__magic_name__   ):
			lowercase_    =	"table-transformer"
			lowercase_    =	["past_key_values"]
			lowercase_    =	{
			    "hidden_size": "d_model",
			    "num_attention_heads": "encoder_attention_heads",
			}


			def __init__(      self      :    List[Any]      ,  UpperCamelCase_      :    int=True      ,  UpperCamelCase_      :    Tuple=None      ,  UpperCamelCase_      :    Optional[int]=3      ,  UpperCamelCase_      :    Any=100      ,  UpperCamelCase_      :    Dict=6      ,  UpperCamelCase_      :    List[str]=2048      ,  UpperCamelCase_      :    str=8      ,  UpperCamelCase_      :    Any=6      ,  UpperCamelCase_      :    Dict=2048      ,  UpperCamelCase_      :    str=8      ,  UpperCamelCase_      :    Any=0.0      ,  UpperCamelCase_      :    str=0.0      ,  UpperCamelCase_      :    Union[str, Any]=True      ,  UpperCamelCase_      :    Optional[int]="relu"      ,  UpperCamelCase_      :    str=256      ,  UpperCamelCase_      :    str=0.1      ,  UpperCamelCase_      :    Tuple=0.0      ,  UpperCamelCase_      :    Dict=0.0      ,  UpperCamelCase_      :    Dict=0.02      ,  UpperCamelCase_      :    Optional[Any]=1.0      ,  UpperCamelCase_      :    Optional[int]=False      ,  UpperCamelCase_      :    int="sine"      ,  UpperCamelCase_      :    Optional[Any]="resnet50"      ,  UpperCamelCase_      :    List[str]=True      ,  UpperCamelCase_      :    int=False      ,  UpperCamelCase_      :    Tuple=1      ,  UpperCamelCase_      :    Any=5      ,  UpperCamelCase_      :    Optional[Any]=2      ,  UpperCamelCase_      :    int=1      ,  UpperCamelCase_      :    List[str]=1      ,  UpperCamelCase_      :    List[str]=5      ,  UpperCamelCase_      :    Union[str, Any]=2      ,  UpperCamelCase_      :    Optional[int]=0.1      ,  **UpperCamelCase_      :    int      ,  ):


						"""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	: int		=					CONFIG_MAPPING["resnet"](out_features=["stage4"])
									elif isinstance(UpperCamelCase_      ,  UpperCamelCase_):
												__UpperCAmelCase	: List[Any]		=					backbone_config.get("model_type")
												__UpperCAmelCase	: List[Any]		=					CONFIG_MAPPING[backbone_model_type]
												__UpperCAmelCase	: Optional[int]		=					config_class.from_dict(UpperCamelCase_)
									# set timm attributes to None
									__UpperCAmelCase	,     __UpperCAmelCase	,     __UpperCAmelCase	: List[Any]		=					None, None, None

						__UpperCAmelCase	: str		=					use_timm_backbone
						__UpperCAmelCase	: int		=					backbone_config
						__UpperCAmelCase	: Dict		=					num_channels
						__UpperCAmelCase	: Optional[Any]		=					num_queries
						__UpperCAmelCase	: List[Any]		=					d_model
						__UpperCAmelCase	: Union[str, Any]		=					encoder_ffn_dim
						__UpperCAmelCase	: int		=					encoder_layers
						__UpperCAmelCase	: Union[str, Any]		=					encoder_attention_heads
						__UpperCAmelCase	: str		=					decoder_ffn_dim
						__UpperCAmelCase	: Any		=					decoder_layers
						__UpperCAmelCase	: Dict		=					decoder_attention_heads
						__UpperCAmelCase	: List[Any]		=					dropout
						__UpperCAmelCase	: int		=					attention_dropout
						__UpperCAmelCase	: str		=					activation_dropout
						__UpperCAmelCase	: Union[str, Any]		=					activation_function
						__UpperCAmelCase	: Optional[int]		=					init_std
						__UpperCAmelCase	: Dict		=					init_xavier_std
						__UpperCAmelCase	: Tuple		=					encoder_layerdrop
						__UpperCAmelCase	: Any		=					decoder_layerdrop
						__UpperCAmelCase	: Tuple		=					encoder_layers
						__UpperCAmelCase	: Optional[int]		=					auxiliary_loss
						__UpperCAmelCase	: List[str]		=					position_embedding_type
						__UpperCAmelCase	: List[str]		=					backbone
						__UpperCAmelCase	: Optional[int]		=					use_pretrained_backbone
						__UpperCAmelCase	: Union[str, Any]		=					dilation
						# Hungarian matcher
						__UpperCAmelCase	: List[Any]		=					class_cost
						__UpperCAmelCase	: Tuple		=					bbox_cost
						__UpperCAmelCase	: int		=					giou_cost
						# Loss coefficients
						__UpperCAmelCase	: Any		=					mask_loss_coefficient
						__UpperCAmelCase	: Optional[Any]		=					dice_loss_coefficient
						__UpperCAmelCase	: Any		=					bbox_loss_coefficient
						__UpperCAmelCase	: int		=					giou_loss_coefficient
						__UpperCAmelCase	: List[Any]		=					eos_coefficient
						super().__init__(is_encoder_decoder=UpperCamelCase_      ,  **UpperCamelCase_)


			@property
			def       a_     (      self      :    int):


						"""simple docstring"""




						return self.encoder_attention_heads


			@property
			def       a_     (      self      :    int):


						"""simple docstring"""




						return self.d_model






class      a__				(	__magic_name__   ):
			lowercase_    =	version.parse("1.11"   )


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


						"""simple docstring"""




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


			@property
			def       a_     (      self      :    int):


						"""simple docstring"""




						return 1e-5


			@property
			def       a_     (      self      :    Tuple):


						"""simple docstring"""




						return 12


