'''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


__lowercase          =  logging.get_logger(__name__)

__lowercase          =  {
    '''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__	):


			'''simple docstring'''






			UpperCAmelCase_			:     Union[str, Any]      =       '''swin'''

			UpperCAmelCase_			:     Optional[Any]      =       {
			    '''num_attention_heads''': '''num_heads''',
			    '''num_hidden_layers''': '''num_layers''',
			}



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




					"""simple docstring"""


					super().__init__(**__lowerCAmelCase)

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







class 				a__(					lowerCAmelCase__	):


			'''simple docstring'''






			UpperCAmelCase_			:     List[Any]      =       version.parse('''1.11'''	)



			@property
			def 							a_       (   self):




					"""simple docstring"""


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







			@property
			def 							a_       (   self):




					"""simple docstring"""


					return 1E-4





'''simple docstring'''




from ...utils import logging
from ..ta.modeling_tf_ta import TFTaEncoderModel, TFTaForConditionalGeneration, TFTaModel
from .configuration_mta import MTaConfig


__lowercase          =  logging.get_logger(__name__)

__lowercase          =  '''T5Config'''






class 				a__(					lowerCAmelCase__	):


			'''simple docstring'''






			UpperCAmelCase_			:     List[str]      =       '''mt5'''
			UpperCAmelCase_			:     Tuple      =       MTaConfig







class 				a__(					lowerCAmelCase__	):


			'''simple docstring'''






			UpperCAmelCase_			:     List[Any]      =       '''mt5'''
			UpperCAmelCase_			:     int      =       MTaConfig







class 				a__(					lowerCAmelCase__	):


			'''simple docstring'''






			UpperCAmelCase_			:     Tuple      =       '''mt5'''
			UpperCAmelCase_			:     Union[str, Any]      =       MTaConfig




