



from collections import OrderedDict
from typing import TYPE_CHECKING, Any, Mapping, Optional, Union

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


if TYPE_CHECKING:
       from ... import FeatureExtractionMixin, PreTrainedTokenizerBase, TensorType


a__      :				int   	=			logging.get_logger(__name__)

a__      :				Optional[int]   	=			{
    "microsoft/deberta-v2-xlarge": "https://huggingface.co/microsoft/deberta-v2-xlarge/resolve/main/config.json",
    "microsoft/deberta-v2-xxlarge": "https://huggingface.co/microsoft/deberta-v2-xxlarge/resolve/main/config.json",
    "microsoft/deberta-v2-xlarge-mnli": (
        "https://huggingface.co/microsoft/deberta-v2-xlarge-mnli/resolve/main/config.json"
    ),
    "microsoft/deberta-v2-xxlarge-mnli": (
        "https://huggingface.co/microsoft/deberta-v2-xxlarge-mnli/resolve/main/config.json"
    ),
}



class       UpperCAmelCase__(							_UpperCAmelCase	):

   '''simple docstring'''




   A    :  Dict       				=    '''deberta-v2'''


   def __init__(						self  :			Union[str, Any]			,				lowerCAmelCase  :			Union[str, Any]=12_81_00			,				lowerCAmelCase  :			List[Any]=15_36			,				lowerCAmelCase  :			List[str]=24			,				lowerCAmelCase  :			Dict=24			,				lowerCAmelCase  :			Union[str, Any]=61_44			,				lowerCAmelCase  :			Optional[Any]="gelu"			,				lowerCAmelCase  :			Dict=0.1			,				lowerCAmelCase  :			Optional[int]=0.1			,				lowerCAmelCase  :			List[str]=5_12			,				lowerCAmelCase  :			Tuple=0			,				lowerCAmelCase  :			List[str]=0.02			,				lowerCAmelCase  :			Tuple=1E-7			,				lowerCAmelCase  :			str=False			,				lowerCAmelCase  :			Dict=-1			,				lowerCAmelCase  :			str=0			,				lowerCAmelCase  :			Any=True			,				lowerCAmelCase  :			Optional[int]=None			,				lowerCAmelCase  :			str=0			,				lowerCAmelCase  :			List[Any]="gelu"			,				**lowerCAmelCase  :			List[str]			,				)	->				List[str]:




         """simple docstring"""

         super().__init__(**A_    )

         lowercase__     =  hidden_size
         lowercase__     =  num_hidden_layers
         lowercase__     =  num_attention_heads
         lowercase__     =  intermediate_size
         lowercase__     =  hidden_act
         lowercase__     =  hidden_dropout_prob
         lowercase__     =  attention_probs_dropout_prob
         lowercase__     =  max_position_embeddings
         lowercase__     =  type_vocab_size
         lowercase__     =  initializer_range
         lowercase__     =  relative_attention
         lowercase__     =  max_relative_positions
         lowercase__     =  pad_token_id
         lowercase__     =  position_biased_input

         # Backwards compatibility
         if type(A_    ) == str:
               lowercase__     =  [x.strip() for x in pos_att_type.lower().split('|'    )]

         lowercase__     =  pos_att_type
         lowercase__     =  vocab_size
         lowercase__     =  layer_norm_eps

         lowercase__     =  kwargs.get('pooler_hidden_size'			,				A_    )
         lowercase__     =  pooler_dropout
         lowercase__     =  pooler_hidden_act



class       UpperCAmelCase__(							_UpperCAmelCase	):

   '''simple docstring'''




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




         """simple docstring"""

         if self.task == "multiple-choice":
               lowercase__     =  {0: 'batch', 1: 'choice', 2: 'sequence'}
         else:
               lowercase__     =  {0: 'batch', 1: 'sequence'}
         if self._config.type_vocab_size > 0:
               return OrderedDict(
                   [('input_ids', dynamic_axis), ('attention_mask', dynamic_axis), ('token_type_ids', dynamic_axis)]    )
         else:
               return OrderedDict([('input_ids', dynamic_axis), ('attention_mask', dynamic_axis)]    )


   @property
   def 			UpperCAmelCase		(						self  :			Tuple    )	->				int:




         """simple docstring"""

         return 12



   def 			UpperCAmelCase		(						self  :			Optional[int]			,				lowerCAmelCase  :			Union["PreTrainedTokenizerBase", "FeatureExtractionMixin"]			,				lowerCAmelCase  :			int = -1			,				lowerCAmelCase  :			int = -1			,				lowerCAmelCase  :			int = -1			,				lowerCAmelCase  :			bool = False			,				lowerCAmelCase  :			Optional["TensorType"] = None			,				lowerCAmelCase  :			int = 3			,				lowerCAmelCase  :			int = 40			,				lowerCAmelCase  :			int = 40			,				lowerCAmelCase  :			"PreTrainedTokenizerBase" = None			,				)	->				Mapping[str, Any]:




         """simple docstring"""

         lowercase__     =  super().generate_dummy_inputs(preprocessor=A_			,				framework=A_    )
         if self._config.type_vocab_size == 0 and "token_type_ids" in dummy_inputs:
               del dummy_inputs["token_type_ids"]
         return dummy_inputs





from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


a__      :				List[str]   	=			logging.get_logger(__name__)

a__      :				List[Any]   	=			{
    "microsoft/focalnet-tiny": "https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json",
}



class       UpperCAmelCase__(							lowerCamelCase     ,							lowerCamelCase	):

   '''simple docstring'''




   A    :  List[str]       				=    "focalnet"


   def __init__(						self  :			Dict			,				lowerCAmelCase  :			Union[str, Any]=2_24			,				lowerCAmelCase  :			List[str]=4			,				lowerCAmelCase  :			int=3			,				lowerCAmelCase  :			Union[str, Any]=96			,				lowerCAmelCase  :			List[Any]=False			,				lowerCAmelCase  :			int=[1_92, 3_84, 7_68, 7_68]			,				lowerCAmelCase  :			str=[2, 2, 6, 2]			,				lowerCAmelCase  :			Tuple=[2, 2, 2, 2]			,				lowerCAmelCase  :			Optional[Any]=[3, 3, 3, 3]			,				lowerCAmelCase  :			int="gelu"			,				lowerCAmelCase  :			Any=4.0			,				lowerCAmelCase  :			List[str]=0.0			,				lowerCAmelCase  :			Union[str, Any]=0.1			,				lowerCAmelCase  :			Union[str, Any]=False			,				lowerCAmelCase  :			Tuple=1E-4			,				lowerCAmelCase  :			List[Any]=False			,				lowerCAmelCase  :			Optional[int]=False			,				lowerCAmelCase  :			List[str]=False			,				lowerCAmelCase  :			str=0.02			,				lowerCAmelCase  :			Optional[int]=1E-5			,				lowerCAmelCase  :			List[Any]=32			,				lowerCAmelCase  :			List[Any]=None			,				lowerCAmelCase  :			Union[str, Any]=None			,				**lowerCAmelCase  :			str			,				)	->				List[str]:




         """simple docstring"""

         super().__init__(**lowerCAmelCase)

         lowercase__     =  image_size
         lowercase__     =  patch_size
         lowercase__     =  num_channels
         lowercase__     =  embed_dim
         lowercase__     =  use_conv_embed
         lowercase__     =  hidden_sizes
         lowercase__     =  depths
         lowercase__     =  focal_levels
         lowercase__     =  focal_windows
         lowercase__     =  hidden_act
         lowercase__     =  mlp_ratio
         lowercase__     =  hidden_dropout_prob
         lowercase__     =  drop_path_rate
         lowercase__     =  use_layerscale
         lowercase__     =  layerscale_value
         lowercase__     =  use_post_layernorm
         lowercase__     =  use_post_layernorm_in_modulation
         lowercase__     =  normalize_modulator
         lowercase__     =  initializer_range
         lowercase__     =  layer_norm_eps
         lowercase__     =  encoder_stride
         lowercase__     =  ['stem'] + [f'''stage{idx}''' for idx in range(1			,				len(self.depths) + 1)]
         lowercase__,	lowercase__     =  get_aligned_output_features_output_indices(
             out_features=lowerCAmelCase			,				out_indices=lowerCAmelCase			,				stage_names=self.stage_names)
