Ë
    ÜÓ^jä  ã                   ó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_headséd   Úsinkhorn_iterationsg        Úmatching_thresholdg{®Gáz”?Ú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/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/superglue/configuration_superglue.pyr)   zSuperGlueConfig.__post_init__B   sÛ   ø€ Ø9=×9NÑ9NÐ9Z × 5Ò 5ÐagÐipÐ`qÐtuÑ`uˆÔà+/×+FÑ+FÐ+RˆD×'Ò'ÒXjð 	Ô#ô �d×3Ñ3´TÔ:Ø:>×:WÑ:W×:[Ñ:[Ð\hÐjvÓ:wˆD×)Ñ)¨,Ñ7Ü,:¸4×;XÑ;XÐYeÑ;fÑ,gñ -Ø×/Ñ/ñ-ˆDÕ)ð ×*Ñ*Ð2Ü,:¸<Ñ,HÓ,JˆDÔ)ä‰ÑÑ' Ó'ó    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   € ô Ñ[ÀT×EZÑEZÔ[Ô[ÜÐ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Ø)-Ð�d˜3‘i $Ñ&Ó-Ø Ð˜Ó Ø"Ð˜Ó"Ø #Ð˜Ó#Ø#Ð�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-   