






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 ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


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

__a:     Union[str, Any]   					=					{
    "microsoft/swin-tiny-patch4-window7-224": (
        "https://huggingface.co/microsoft/swin-tiny-patch4-window7-224/resolve/main/config.json"
    ),
    # See all Swin models at https://huggingface.co/models?filter=swin
}
class 		SCREAMING_SNAKE_CASE__	(  UpperCamelCase__					,      UpperCamelCase__     ):

  '''simple docstring'''







  _lowerCamelCase    =  '''swin'''

  _lowerCamelCase    =  {
      '''num_attention_heads''': '''num_heads''',
      '''num_hidden_layers''': '''num_layers''',
  }


  def __init__(      self		:			List[Any]       ,				lowerCamelCase		:			Optional[int]=224       ,				lowerCamelCase		:			str=4       ,				lowerCamelCase		:			Tuple=3       ,				lowerCamelCase		:			Any=96       ,				lowerCamelCase		:			Any=[2, 2, 6, 2]       ,				lowerCamelCase		:			Union[str, Any]=[3, 6, 12, 24]       ,				lowerCamelCase		:			Optional[int]=7       ,				lowerCamelCase		:			str=4.0       ,				lowerCamelCase		:			Optional[Any]=True       ,				lowerCamelCase		:			Any=0.0       ,				lowerCamelCase		:			int=0.0       ,				lowerCamelCase		:			int=0.1       ,				lowerCamelCase		:			Optional[int]="gelu"       ,				lowerCamelCase		:			Any=False       ,				lowerCamelCase		:			Union[str, Any]=0.02       ,				lowerCamelCase		:			Dict=1E-5       ,				lowerCamelCase		:			Dict=32       ,				lowerCamelCase		:			Any=None       ,				lowerCamelCase		:			List[str]=None       ,				**lowerCamelCase		:			Union[str, Any]       ,				)						->	int:


         """simple docstring"""
         super().__init__(**__snake_case							)

         _UpperCAmelCase							=    image_size
         _UpperCAmelCase							=    patch_size
         _UpperCAmelCase							=    num_channels
         _UpperCAmelCase							=    embed_dim
         _UpperCAmelCase							=    depths
         _UpperCAmelCase							=    len(__snake_case							)
         _UpperCAmelCase							=    num_heads
         _UpperCAmelCase							=    window_size
         _UpperCAmelCase							=    mlp_ratio
         _UpperCAmelCase							=    qkv_bias
         _UpperCAmelCase							=    hidden_dropout_prob
         _UpperCAmelCase							=    attention_probs_dropout_prob
         _UpperCAmelCase							=    drop_path_rate
         _UpperCAmelCase							=    hidden_act
         _UpperCAmelCase							=    use_absolute_embeddings
         _UpperCAmelCase							=    layer_norm_eps
         _UpperCAmelCase							=    initializer_range
         _UpperCAmelCase							=    encoder_stride
         # we set the hidden_size attribute in order to make Swin work with VisionEncoderDecoderModel
         # this indicates the channel dimension after the last stage of the model
         _UpperCAmelCase							=    int(embed_dim * 2 ** (len(__snake_case							) - 1)							)
         _UpperCAmelCase							=    ["""stem"""] + [f"""stage{idx}""" for idx in range(1       ,				len(__snake_case							) + 1							)]
         _UpperCAmelCase							=    get_aligned_output_features_output_indices(
             out_features=__snake_case       ,				out_indices=__snake_case       ,				stage_names=self.stage_names							)



class 		SCREAMING_SNAKE_CASE__	(  UpperCamelCase__     ):

  '''simple docstring'''







  _lowerCamelCase    =  version.parse('''1.11'''     )


  @property
  def  lowerCamelCase       (      self		:			Optional[Any]							)						->	Union[str, Any]:


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





  @property
  def  lowerCamelCase       (      self		:			List[Any]							)						->	Optional[Any]:


         """simple docstring"""
         return 1E-4





from collections import OrderedDict
from typing import Mapping

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


UpperCAmelCase_		:					Tuple          =  logging.get_logger(__name__)

UpperCAmelCase_		:					List[str]          =  {
    "facebook/xlm-roberta-xl": "https://huggingface.co/facebook/xlm-roberta-xl/resolve/main/config.json",
    "facebook/xlm-roberta-xxl": "https://huggingface.co/facebook/xlm-roberta-xxl/resolve/main/config.json",
    # See all XLM-RoBERTa-XL models at https://huggingface.co/models?filter=xlm-roberta-xl
}




class 		__A   (      UpperCamelCase__      ):
						UpperCamelCase      =       """xlm-roberta-xl"""

						def __init__(		self :Dict     ,			__snake_case :Optional[Any]=25_08_80     ,			__snake_case :List[Any]=25_60     ,			__snake_case :Optional[Any]=36     ,			__snake_case :Any=32     ,			__snake_case :int=1_02_40     ,			__snake_case :List[Any]="gelu"     ,			__snake_case :Union[str, Any]=0.1     ,			__snake_case :Optional[Any]=0.1     ,			__snake_case :str=5_14     ,			__snake_case :Union[str, Any]=1     ,			__snake_case :Optional[int]=0.02     ,			__snake_case :str=1E-05     ,			__snake_case :str=1     ,			__snake_case :int=0     ,			__snake_case :Tuple=2     ,			__snake_case :Optional[int]="absolute"     ,			__snake_case :str=True     ,			__snake_case :Any=None     ,			**__snake_case :Dict     ,			):
										'''simple docstring'''

										super().__init__(pad_token_id=__snake_case     ,			bos_token_id=__snake_case     ,			eos_token_id=__snake_case     ,			**__snake_case			)
										__magic_name__						:						List[str]										=vocab_size
										__magic_name__						:						List[str]										=hidden_size
										__magic_name__						:						Union[str, Any]										=num_hidden_layers
										__magic_name__						:						Any										=num_attention_heads
										__magic_name__						:						Any										=hidden_act
										__magic_name__						:						List[str]										=intermediate_size
										__magic_name__						:						Any										=hidden_dropout_prob
										__magic_name__						:						Union[str, Any]										=attention_probs_dropout_prob
										__magic_name__						:						Any										=max_position_embeddings
										__magic_name__						:						Any										=type_vocab_size
										__magic_name__						:						List[str]										=initializer_range
										__magic_name__						:						Optional[int]										=layer_norm_eps
										__magic_name__						:						Dict										=position_embedding_type
										__magic_name__						:						Any										=use_cache
										__magic_name__						:						Dict										=classifier_dropout




class 		__A   (      UpperCamelCase__      ):

						@property
						def      A__    (		self :Dict			):
										'''simple docstring'''

										if self.task == "multiple-choice":
														__magic_name__						:						str										={0: """batch""", 1: """choice""", 2: """sequence"""}
										else:
														__magic_name__						:						Optional[Any]										={0: """batch""", 1: """sequence"""}
										return OrderedDict(
										    [
										        ("""input_ids""", dynamic_axis),
										        ("""attention_mask""", dynamic_axis),
										    ]			)




