
    i                     v    d dl mZ ddlmZ ddlmZ ddlmZmZ  ed      e G d	 d
e                    Z	d
gZ
y)    )strict   )PreTrainedConfig)auto_docstring   )CONFIG_MAPPING
AutoConfigz%magic-leap-community/superglue_indoor)
checkpointc                        e Zd ZU dZdZdeiZdZee	z  dz  e
d<   dZee
d<   dZee   dz  e
d<   dZee   d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z  e
d<    fdZd Z xZS )SuperGlueConfiga  
    keypoint_detector_config (`Union[AutoConfig, dict]`,  *optional*, defaults to `SuperPointConfig`):
        The config object or dictionary of the keypoint detector.
    keypoint_encoder_sizes (`list[int]`, *optional*, defaults to `[32, 64, 128, 256]`):
        The sizes of the keypoint encoder layers.
    gnn_layers_types (`list[str]`, *optional*, defaults to `['self', 'cross', 'self', 'cross', 'self', 'cross', 'self', 'cross', 'self', 'cross', 'self', 'cross', 'self', 'cross', 'self', 'cross', 'self', 'cross']`):
        The types of the GNN layers. Must be either 'self' or 'cross'.
    sinkhorn_iterations (`int`, *optional*, defaults to 100):
        The number of Sinkhorn iterations.
    matching_threshold (`float`, *optional*, defaults to 0.0):
        The matching threshold.

    Examples:
        ```python
        >>> from transformers import SuperGlueConfig, SuperGlueModel

        >>> # Initializing a SuperGlue superglue style configuration
        >>> configuration = SuperGlueConfig()

        >>> # Initializing a model from the superglue style configuration
        >>> model = SuperGlueModel(configuration)

        >>> # Accessing the model configuration
        >>> configuration = model.config
        ```
    	supergluekeypoint_detector_configN   hidden_sizekeypoint_encoder_sizesgnn_layers_types   num_attention_headsd   sinkhorn_iterationsg        matching_thresholdg{Gz?initializer_rangeF
is_decoderattention_probs_dropout_probc                    | j                   | j                   nddgdz  | _         | j                  | j                  ng d| _        t        | j                  t              rT| j                  j                  dd      | j                  d<   t        | j                  d      di | j                  | _        n| j                  t        d          | _        t        |    di | y )Nselfcross	   )    @      r   
model_type
superpoint )	r   r   
isinstancer   dictgetr   super__post_init__)r   kwargs	__class__s     /var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/transformers/models/superglue/configuration_superglue.pyr)   zSuperGlueConfig.__post_init__B   s    9=9N9N9Z 5 5agip`qtu`u+/+F+F+RD''Xj 	# d33T::>:W:W:[:[\hjv:wD)),7,:4;X;XYe;f,g -//-D) **2,:<,H,JD)''    c                     t        d | j                  D              st        d      | j                  | j                  z  dk7  rt        d      y)zOPart of `@strict`-powered validation. Validates the architecture of the config.c              3   $   K   | ]  }|d v  
 yw))r   r   Nr$   ).0
layer_types     r,   	<genexpr>z8SuperGlueConfig.validate_architecture.<locals>.<genexpr>U   s     [z:!22[s   z5All gnn_layers_types must be either 'self' or 'cross'r   z8hidden_size % num_attention_heads is different from zeroN)allr   
ValueErrorr   r   )r   s    r,   validate_architecturez%SuperGlueConfig.validate_architectureR   sN     [TEZEZ[[TUUd666!;WXX <r-   )__name__
__module____qualname____doc__r"   r	   sub_configsr   r&   r   __annotations__r   intr   listr   strr   r   r   floatr   r   boolr   r)   r5   __classcell__)r+   s   @r,   r   r      s    6 J-z:K?Cd%55<CK/3DI,3)-d3i$&-  "" ###u#J03 #+3( Yr-   r   N)huggingface_hub.dataclassesr   configuration_utilsr   utilsr   autor   r	   r   __all__r$   r-   r,   <module>rG      sO    / 3 # - BCAY& AY  DAYH 
r-   