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


_UpperCAmelCase    :     Union[str, Any]         =       logging.get_logger(__name__)

_UpperCAmelCase    :     int         =       {
    '''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 lowercase_       (		_UpperCamelCase    ,    _UpperCamelCase			):







   """simple docstring"""

   __lowerCAmelCase         =   "swin"

   __lowerCAmelCase         =   {
       "num_attention_heads": "num_heads",
       "num_hidden_layers": "num_layers",
   }
   def __init__(      self      :			Optional[int], UpperCamelCase__      :			str=2_24, UpperCamelCase__      :			Optional[int]=4, UpperCamelCase__      :			List[Any]=3, UpperCamelCase__      :			str=96, UpperCamelCase__      :			Optional[Any]=[2, 2, 6, 2], UpperCamelCase__      :			Optional[int]=[3, 6, 12, 24], UpperCamelCase__      :			List[Any]=7, UpperCamelCase__      :			Optional[int]=4.0, UpperCamelCase__      :			int=True, UpperCamelCase__      :			Optional[Any]=0.0, UpperCamelCase__      :			Tuple=0.0, UpperCamelCase__      :			Dict=0.1, UpperCamelCase__      :			List[str]="gelu", UpperCamelCase__      :			str=False, UpperCamelCase__      :			Optional[int]=0.02, UpperCamelCase__      :			List[Any]=1e-5, UpperCamelCase__      :			Dict=32, UpperCamelCase__      :			int=None, UpperCamelCase__      :			List[Any]=None, **UpperCamelCase__      :			Optional[int], )  ->			Union[str, Any]:
        super().__init__(**UpperCamelCase__     )

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







class lowercase_       (		_UpperCamelCase			):







   """simple docstring"""

   __lowerCAmelCase         =   version.parse("1.11"			)
   @property
   def 	__UpperCAmelCase   (      self      :			List[str]     )  ->			Mapping[str, Mapping[int, str]]:
        return OrderedDict(
            [
                ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
            ]     )

   @property
   def 	__UpperCAmelCase   (      self      :			List[Any]     )  ->			float:
        return 1e-4




'''simple docstring'''






from . import (
    albert,
    align,
    altclip,
    audio_spectrogram_transformer,
    auto,
    autoformer,
    bark,
    bart,
    barthez,
    bartpho,
    beit,
    bert,
    bert_generation,
    bert_japanese,
    bertweet,
    big_bird,
    bigbird_pegasus,
    biogpt,
    bit,
    blenderbot,
    blenderbot_small,
    blip,
    blip_a,
    bloom,
    bridgetower,
    byta,
    camembert,
    canine,
    chinese_clip,
    clap,
    clip,
    clipseg,
    codegen,
    conditional_detr,
    convbert,
    convnext,
    convnextva,
    cpm,
    cpmant,
    ctrl,
    cvt,
    dataavec,
    deberta,
    deberta_va,
    decision_transformer,
    deformable_detr,
    deit,
    deprecated,
    deta,
    detr,
    dialogpt,
    dinat,
    distilbert,
    dit,
    donut,
    dpr,
    dpt,
    efficientformer,
    efficientnet,
    electra,
    encodec,
    encoder_decoder,
    ernie,
    ernie_m,
    esm,
    falcon,
    flaubert,
    flava,
    fnet,
    focalnet,
    fsmt,
    funnel,
    git,
    glpn,
    gpta,
    gpt_bigcode,
    gpt_neo,
    gpt_neox,
    gpt_neox_japanese,
    gpt_swa,
    gptj,
    gptsan_japanese,
    graphormer,
    groupvit,
    herbert,
    hubert,
    ibert,
    imagegpt,
    informer,
    instructblip,
    jukebox,
    layoutlm,
    layoutlmva,
    layoutlmva,
    layoutxlm,
    led,
    levit,
    lilt,
    llama,
    longformer,
    longta,
    luke,
    lxmert,
    mam_aaa,
    marian,
    markuplm,
    maskaformer,
    maskformer,
    mbart,
    mbartaa,
    mega,
    megatron_bert,
    megatron_gpta,
    mgp_str,
    mluke,
    mobilebert,
    mobilenet_va,
    mobilenet_va,
    mobilevit,
    mobilevitva,
    mpnet,
    mra,
    mta,
    musicgen,
    mvp,
    nat,
    nezha,
    nllb,
    nllb_moe,
    nystromformer,
    oneformer,
    open_llama,
    openai,
    opt,
    owlvit,
    pegasus,
    pegasus_x,
    perceiver,
    phobert,
    pixastruct,
    plbart,
    poolformer,
    prophetnet,
    qdqbert,
    rag,
    realm,
    reformer,
    regnet,
    rembert,
    resnet,
    roberta,
    roberta_prelayernorm,
    roc_bert,
    roformer,
    rwkv,
    sam,
    segformer,
    sew,
    sew_d,
    speech_encoder_decoder,
    speech_to_text,
    speech_to_text_a,
    speechta,
    splinter,
    squeezebert,
    swiftformer,
    swin,
    swinasr,
    swinva,
    switch_transformers,
    ta,
    table_transformer,
    tapas,
    time_series_transformer,
    timesformer,
    timm_backbone,
    transfo_xl,
    trocr,
    tvlt,
    umta,
    unispeech,
    unispeech_sat,
    upernet,
    videomae,
    vilt,
    vision_encoder_decoder,
    vision_text_dual_encoder,
    visual_bert,
    vit,
    vit_hybrid,
    vit_mae,
    vit_msn,
    vivit,
    wavaveca,
    wavaveca_conformer,
    wavaveca_phoneme,
    wavaveca_with_lm,
    wavlm,
    whisper,
    x_clip,
    xglm,
    xlm,
    xlm_prophetnet,
    xlm_roberta,
    xlm_roberta_xl,
    xlnet,
    xmod,
    yolos,
    yoso,
)



