
"""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__ :    Optional[int]        =		logging.get_logger(__name__)

lowerCamelCase__ :    Optional[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 			A__	(     _lowerCamelCase	,					_lowerCamelCase):
		A_						:	str           =     'swin'

		A_						:	Union[str, Any]           =     {
		    'num_attention_heads': 'num_heads',
		    'num_hidden_layers': 'num_layers',
		}

		def __init__(				self	,		_SCREAMING_SNAKE_CASE=2_24	,		_SCREAMING_SNAKE_CASE=4	,		_SCREAMING_SNAKE_CASE=3	,		_SCREAMING_SNAKE_CASE=96	,		_SCREAMING_SNAKE_CASE=[2, 2, 6, 2]	,		_SCREAMING_SNAKE_CASE=[3, 6, 12, 24]	,		_SCREAMING_SNAKE_CASE=7	,		_SCREAMING_SNAKE_CASE=4.0	,		_SCREAMING_SNAKE_CASE=True	,		_SCREAMING_SNAKE_CASE=0.0	,		_SCREAMING_SNAKE_CASE=0.0	,		_SCREAMING_SNAKE_CASE=0.1	,		_SCREAMING_SNAKE_CASE="gelu"	,		_SCREAMING_SNAKE_CASE=False	,		_SCREAMING_SNAKE_CASE=0.02	,		_SCREAMING_SNAKE_CASE=1E-5	,		_SCREAMING_SNAKE_CASE=32	,		_SCREAMING_SNAKE_CASE=None	,		_SCREAMING_SNAKE_CASE=None	,		**_SCREAMING_SNAKE_CASE	,		):
			super().__init__(**_SCREAMING_SNAKE_CASE			)

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




class 			A__	(     _lowerCamelCase):
		A_						:	str           =     version.parse('1.11')

		@property
		def 							__lowerCamelCase							(				self			):
			return OrderedDict(
			    [
			        ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
			    ]			)







		@property
		def 							__lowerCamelCase							(				self			):
			return 1E-4

"""simple docstring"""







from .glue import glue_convert_examples_to_features, glue_output_modes, glue_processors, glue_tasks_num_labels
from .squad import SquadExample, SquadFeatures, SquadVaProcessor, SquadVaProcessor, squad_convert_examples_to_features
from .utils import DataProcessor, InputExample, InputFeatures, SingleSentenceClassificationProcessor
from .xnli import xnli_output_modes, xnli_processors, xnli_tasks_num_labels