
    i                     x    d Z ddlmZ ddlmZ ddlmZ ddlmZ  ed      e G d	 d
ee                    Z	d
gZ
y)z$Swin Transformer model configuration    )strict   )BackboneConfigMixin)PreTrainedConfig)auto_docstringz&microsoft/swin-tiny-patch4-window7-224)
checkpointc                       e Zd ZU dZdZdddZdZeee   z  e	eef   z  e
d<   dZeee   z  e	eef   z  e
d	<   d
Zee
d<   dZee
d<   dZee   e	edf   z  e
d<   dZee   e	edf   z  e
d<   dZee
d<   dZeez  e
d<   dZee
d<   dZeez  e
d<   dZeez  e
d<   dZeez  e
d<   dZee
d<   dZee
d <   d!Zee
d"<   d#Zee
d$<   d%Zee
d&<   d'Zee   d'z  e
d(<   d'Zee   d'z  e
d)<    fd*Z  xZ!S )+
SwinConfiga  
    depths (`list(int)`, *optional*, defaults to `[2, 2, 6, 2]`):
        Depth of each layer in the Transformer encoder.
    num_heads (`list(int)`, *optional*, defaults to `[3, 6, 12, 24]`):
        Number of attention heads in each layer of the Transformer encoder.
    window_size (`int`, *optional*, defaults to 7):
        Size of windows.
    encoder_stride (`int`, *optional*, defaults to 32):
        Factor to increase the spatial resolution by in the decoder head for masked image modeling.

    Example:

    ```python
    >>> from transformers import SwinConfig, SwinModel

    >>> # Initializing a Swin microsoft/swin-tiny-patch4-window7-224 style configuration
    >>> configuration = SwinConfig()

    >>> # Initializing a model (with random weights) from the microsoft/swin-tiny-patch4-window7-224 style configuration
    >>> model = SwinModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```swin	num_heads
num_layers)num_attention_headsnum_hidden_layers   
image_size   
patch_sizer   num_channels`   	embed_dim)   r      r   .depths)r   r            window_sizeg      @	mlp_ratioTqkv_biasg        hidden_dropout_probattention_probs_dropout_probg?drop_path_rategelu
hidden_actFuse_absolute_embeddingsg{Gz?initializer_rangegh㈵>layer_norm_eps    encoder_strideN_out_features_out_indicesc                    t        | j                        | _        t        | j                  dt        | j                        dz
  z  z        | _        dgt        dt        | j                        dz         D cg c]  }d| 	 c}z   | _        | j                  |j                  dd       |j                  dd              t        | ,  di | y c c}w )	Nr      stemstageout_indicesout_features)r0   r1    )lenr   r   intr   hidden_sizerangestage_names"set_output_features_output_indicespopsuper__post_init__)selfkwargsidx	__class__s      |/var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/transformers/models/swin/configuration_swin.pyr;   zSwinConfig.__post_init__N   s    dkk* t~~c$++6F6J0KKL"8aT[[IY\]I]@^&_se}&__//

=$7fjjQ_aeFf 	0 	
 	''	 '`s   8C)"__name__
__module____qualname____doc__
model_typeattribute_mapr   r4   listtuple__annotations__r   r   r   r   r   r   r   floatr   boolr    r!   r"   r$   strr%   r&   r'   r)   r*   r+   r;   __classcell__)r?   s   @r@   r
   r
      sZ   2 J  +)M
 58Jd3i%S/1745Jd3i%S/15L#Is*6FDIc3h'6-;ItCy5c?*;K Ius{ Hd'**03 %#+3"%NECK%J$)T)#u# NE NC&*M49t#*%)L$s)d")	( 	(    r
   N)rD   huggingface_hub.dataclassesr   backbone_utilsr   configuration_utilsr   utilsr   r
   __all__r2   rN   r@   <module>rT      sN    + . 1 3 # CD>($&6 >(  E>(B .rN   