
    Χgm                    |    d dl mZ d dlmZ  ed           G d d                      ZddZddZddZddZdS )    )annotations)	dataclassT)frozenc                  z    e Zd ZU ded<   ded<   ded<   ded<   ded<   edd            Zedd            ZddZdS )SelectiveBuildOperatorstrnameboolis_root_operatoris_used_for_traininginclude_all_overloadstuple[str, ...] | None_debug_infoop_nameop_infodict[str, object]returnc           
        h d}t          t          |                                          |z
            dk    rWt          d                    d                    t          |                                          |z
                                d|v r| |d         k    sJ |                    dd          }t          |t                    sJ |                    dd          }t          |t                    sJ |                    d	d          }t          |t                    sJ d }d
|v r8|d
         }t          |t                    sJ t          d |D                       }t          | ||||          S )N>   r	   
debug_infor   r   r   r   z!Got unexpected top level keys: {},r	   r   Tr   r   r   c              3  4   K   | ]}t          |          V  d S N)r   ).0xs     ]/var/www/html/ai-engine/env/lib/python3.11/site-packages/torchgen/selective_build/operator.py	<genexpr>z8SelectiveBuildOperator.from_yaml_dict.<locals>.<genexpr>W   s(      77!s1vv777777    r	   r   r   r   r   )lensetkeys	Exceptionformatjoinget
isinstancer
   listtupler   )r   r   allowed_keysr   r   r   r   di_lists           r   from_yaml_dictz%SelectiveBuildOperator.from_yaml_dict4   s   
 
 
 s7<<>>""\122Q663::HHS00<?@@    Wgfo----";;'94@@*D11111&{{+A4HH.55555 ',CT J J/66666-1
7""l+Ggt,,,,,77w77777J%-!5"7"
 
 
 	
r   c                *    t          | dddd           S )NTr   )r   )r	   s    r   *from_legacy_operator_name_without_overloadzASelectiveBuildOperator.from_legacy_operator_name_without_overloada   s*     &!!%"&
 
 
 	
r   c                R    | j         | j        | j        d}| j        
| j        |d<   |S )N)r   r   r   r   )r   r   r   r   )selfrets     r   to_dictzSelectiveBuildOperator.to_dictm   s=     $ 5$($=%)%?"
 "

 ' $ 0C
r   N)r   r   r   r   r   r   )r	   r   r   r   )r   r   )__name__
__module____qualname____annotations__staticmethodr+   r-   r1    r   r   r   r      s          III     ('''*
 *
 *
 \*
X 	
 	
 	
 \	
	 	 	 	 	 	r   r   lhsr   rhsr   c                T    | |d S t          t          | pd|pdz                       S )Nr7   )r(   r    r8   r9   s     r   merge_debug_infor<   y   s5    
 {s{tciRCI2.//000r   c           
     t   t          | j                  t          |j                  k    r:t          dt          | j                   dt          |j                   d          t          | j        | j        p|j        | j        p|j        | j        p|j        t          | j        |j                            S )Nz8Expected both arguments to have the same name, but got 'z' and 'z	' insteadr   )	r   r	   r"   r   r   r   r   r<   r   r;   s     r   combine_operatorsr>      s     38}}CH%%us38}}uu]`adai]j]juuu
 
 	
 "X -E1E !5Q9Q!7T3;T$S_coFF   r   !dict[str, SelectiveBuildOperator]c                    i }t          |                                           t          |                                          z   D ]&\  }}|}||v rt          ||         |          }|||<   '|S r   )r'   itemsr>   )r8   r9   	operatorsr   opnew_ops         r   merge_operator_dictsrE      sx     46ICIIKK((4		+<+<< $ $i&y'92>>F#	'r   r   r   c                8    |                      d          d         S )N.r   )split)r   s    r   strip_operator_overload_namerI      s    ==a  r   N)r8   r   r9   r   r   r   )r8   r   r9   r   r   r   )r8   r?   r9   r?   r   r?   )r   r   r   r   )	
__future__r   dataclassesr   r   r<   r>   rE   rI   r7   r   r   <module>rL      s    " " " " " " ! ! ! ! ! ! $i i i i i i i iX1 1 1 1   .   ! ! ! ! ! !r   