
    i                     j    d Z ddlmZ ddlmZ ddlmZ  ed      e G d d	e                    Zd	gZy
)z'Swin2SR Transformer model configuration    )strict   )PreTrainedConfig)auto_docstringz caidas/swin2sr-classicalsr-x2-64)
checkpointc                       e Zd ZU dZdZd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dz  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
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)<   d*Z ee
d+<   d,Z!ee
d-<    fd.Z" xZ#S )/Swin2SRConfiga:  
    num_channels_out (`int`, *optional*, defaults to `num_channels`):
        The number of output channels. If not set, it will be set to `num_channels`.
    depths (`list(int)`, *optional*, defaults to `[6, 6, 6, 6, 6, 6]`):
        Depth of each layer in the Transformer encoder.
    num_heads (`list(int)`, *optional*, defaults to `[6, 6, 6, 6, 6, 6]`):
        Number of attention heads in each layer of the Transformer encoder.
    window_size (`int`, *optional*, defaults to 8):
        Size of windows.
    upscale (`int`, *optional*, defaults to 2):
        The upscale factor for the image. 2/3/4/8 for image super resolution, 1 for denoising and compress artifact
        reduction
    img_range (`float`, *optional*, defaults to 1.0):
        The range of the values of the input image.
    resi_connection (`str`, *optional*, defaults to `"1conv"`):
        The convolutional block to use before the residual connection in each stage.
    upsampler (`str`, *optional*, defaults to `"pixelshuffle"`):
        The reconstruction reconstruction module. Can be 'pixelshuffle'/'pixelshuffledirect'/'nearest+conv'/None.

    Example:

    ```python
    >>> from transformers import Swin2SRConfig, Swin2SRModel

    >>> # Initializing a Swin2SR caidas/swin2sr-classicalsr-x2-64 style configuration
    >>> configuration = Swin2SRConfig()

    >>> # Initializing a model (with random weights) from the caidas/swin2sr-classicalsr-x2-64 style configuration
    >>> model = Swin2SRModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```swin2sr	embed_dim	num_heads
num_layers)hidden_sizenum_attention_headsnum_hidden_layers@   
image_size   
patch_sizer   num_channelsNnum_channels_out   )   r   r   r   r   r   .depths   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   upscaleg      ?	img_range1convresi_connectionpixelshuffle	upsamplerc                     | j                   | j                  n| j                   | _         t        | j                        | _        t        |   di | y )N )r   r   lenr   r   super__post_init__)selfkwargs	__class__s     /var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/transformers/models/swin2sr/configuration_swin2sr.pyr1   zSwin2SRConfig.__post_init__Y   sE    595J5J5R 1 1X\XmXmdkk*''    )$__name__
__module____qualname____doc__
model_typeattribute_mapr   intlisttuple__annotations__r   r   r   r   r   r   r   r   floatr   boolr   r   r    r"   strr#   r$   r%   r'   r(   r*   r,   r1   __classcell__)r4   s   @r5   r	   r	      sa    D J #*)M 57Jd3i%S/1645Jd3i%S/15L##'cDj'Is*<FDIc3h'<-?ItCy5c?*?KIuHd'**03 %#+3"%NECK%J$)T)#u# NE GSIu"OS"#Is#( (r6   r	   N)	r:   huggingface_hub.dataclassesr   configuration_utilsr   utilsr   r	   __all__r.   r6   r5   <module>rI      sK    . . 3 # =>D($ D(  ?D(N 
r6   