



"""simple docstring"""





from collections import OrderedDict
from typing import Mapping

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


__lowerCAmelCase       :					Optional[int]      					=					logging.get_logger(__name__)

__lowerCAmelCase       :					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    _lowerCAmelCase    (				SCREAMING_SNAKE_CASE__		):





		"""simple docstring"""






		_lowerCamelCase			  =       '''xlm-roberta-xl'''





		def __init__(					self							,    _lowercase=2_5_0_8_8_0							,    _lowercase=2_5_6_0							,    _lowercase=3_6							,    _lowercase=3_2							,    _lowercase=1_0_2_4_0							,    _lowercase="gelu"							,    _lowercase=0.1							,    _lowercase=0.1							,    _lowercase=5_1_4							,    _lowercase=1							,    _lowercase=0.02							,    _lowercase=1E-05							,    _lowercase=1							,    _lowercase=0							,    _lowercase=2							,    _lowercase="absolute"							,    _lowercase=True							,    _lowercase=None							,    **_lowercase							,    ) ->						str:







								'''simple docstring'''

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




class    _lowerCAmelCase    (				SCREAMING_SNAKE_CASE__		):





		"""simple docstring"""






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







								'''simple docstring'''

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






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


__lowerCAmelCase       :					Tuple      					=					logging.get_logger(__name__)

__lowerCAmelCase       :					Dict      					=					{
    '''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    _lowerCAmelCase    (				SCREAMING_SNAKE_CASE__  ,				SCREAMING_SNAKE_CASE__		):





		"""simple docstring"""






		_lowerCamelCase			  =       '''swin'''

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





		def __init__(					self							,    _lowercase=2_2_4							,    _lowercase=4							,    _lowercase=3							,    _lowercase=9_6							,    _lowercase=[2, 2, 6, 2]							,    _lowercase=[3, 6, 1_2, 2_4]							,    _lowercase=7							,    _lowercase=4.0							,    _lowercase=True							,    _lowercase=0.0							,    _lowercase=0.0							,    _lowercase=0.1							,    _lowercase="gelu"							,    _lowercase=False							,    _lowercase=0.02							,    _lowercase=1E-5							,    _lowercase=3_2							,    _lowercase=None							,    _lowercase=None							,    **_lowercase							,    ) ->						Union[str, Any]:







								'''simple docstring'''

								super().__init__(**_lowercase   )

								snake_case_   : str						=			image_size
								snake_case_   : int						=			patch_size
								snake_case_   : Optional[int]						=			num_channels
								snake_case_   : Union[str, Any]						=			embed_dim
								snake_case_   : Optional[int]						=			depths
								snake_case_   : Optional[int]						=			len(_lowercase   )
								snake_case_   : Optional[Any]						=			num_heads
								snake_case_   : Optional[Any]						=			window_size
								snake_case_   : Optional[Any]						=			mlp_ratio
								snake_case_   : Optional[Any]						=			qkv_bias
								snake_case_   : Optional[Any]						=			hidden_dropout_prob
								snake_case_   : Tuple						=			attention_probs_dropout_prob
								snake_case_   : Union[str, Any]						=			drop_path_rate
								snake_case_   : List[Any]						=			hidden_act
								snake_case_   : str						=			use_absolute_embeddings
								snake_case_   : str						=			layer_norm_eps
								snake_case_   : Optional[Any]						=			initializer_range
								snake_case_   : Any						=			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
								snake_case_   : Tuple						=			int(embed_dim * 2 ** (len(_lowercase   ) - 1)   )
								snake_case_   : Tuple						=			["""stem"""] + [f'stage{idx}' for idx in range(1							,    len(_lowercase   ) + 1   )]
								snake_case_			,		snake_case_   : Any						=			get_aligned_output_features_output_indices(
								    out_features=_lowercase							,    out_indices=_lowercase							,    stage_names=self.stage_names   )




class    _lowerCAmelCase    (				SCREAMING_SNAKE_CASE__		):





		"""simple docstring"""






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





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







								'''simple docstring'''

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





		@property
		def    UpperCAmelCase__							(					self   ) ->						float:







								'''simple docstring'''

								return 1E-4

