
    iF                         d Z ddlm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ResNet model configuration    )ClassVar)strict   )BackboneConfigMixin)PreTrainedConfig)auto_docstringzmicrosoft/resnet-50)
checkpointc                        e Zd ZU dZdZddgZeee      e	d<   dZ
ee	d<   dZee	d	<   d
Zee   eedf   z  dz  e	d<   dZee   eedf   z  dz  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d Z xZS )ResNetConfiga  
    layer_type (`str`, *optional*, defaults to `"bottleneck"`):
        The layer to use, it can be either `"basic"` (used for smaller models, like resnet-18 or resnet-34) or
        `"bottleneck"` (used for larger models like resnet-50 and above).
    downsample_in_first_stage (`bool`, *optional*, defaults to `False`):
        If `True`, the first stage will downsample the inputs using a `stride` of 2.
    downsample_in_bottleneck (`bool`, *optional*, defaults to `False`):
        If `True`, the first conv 1x1 in ResNetBottleNeckLayer will downsample the inputs using a `stride` of 2.

    Example:
    ```python
    >>> from transformers import ResNetConfig, ResNetModel

    >>> # Initializing a ResNet resnet-50 style configuration
    >>> configuration = ResNetConfig()

    >>> # Initializing a model (with random weights) from the resnet-50 style configuration
    >>> model = ResNetModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```
    resnetbasic
bottlenecklayer_typesr   num_channels@   embedding_size)   i   i   i   .Nhidden_sizes)r         r   depths
layer_typerelu
hidden_actFdownsample_in_first_stagedownsample_in_bottleneckc                 @   dgt        dt        | j                        dz         D cg c]  }d| 	 c}z   | _        | j	                  |j                  dd       |j                  dd              t        | j                        | _        t        | $  di | y c c}w )Nstem   stageout_indicesout_features)r!   r"    )
rangelenr   stage_names"set_output_features_output_indicespoplistr   super__post_init__)selfkwargsidx	__class__s      /var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/transformers/models/resnet/configuration_resnet.pyr+   zResNetConfig.__post_init__@   s    "8aT[[IY\]I]@^&_se}&__//

=$7fjjQ_aeFf 	0 	
 !!2!23'' '`s   Bc                     | j                   | j                  vr4t        d| j                    ddj                  | j                               y)z.Check that `layer_types` is correctly defined.zlayer_type=z is not one of ,N)r   r   
ValueErrorjoin)r,   s    r0   validate_layer_typez ResNetConfig.validate_layer_typeH   sG    ??$"2"22{4??*;?388TXTdTdKeJfghh 3    )__name__
__module____qualname____doc__
model_typer   r   r)   str__annotations__r   intr   r   tupler   r   r   r   boolr   r+   r5   __classcell__)r/   s   @r0   r   r      s    0 J(/'>K$s)$>L#NC7ML$s)eCHo-4M1=FDIc3h'$.="J"J&+t+%*d*(ir6   r   N)r:   typingr   huggingface_hub.dataclassesr   backbone_utilsr   configuration_utilsr   utilsr   r   __all__r#   r6   r0   <module>rH      sT    !  . 1 3 # 010i&(8 0i  20if 
r6   