
    %h              
          d dl Z d dlZd dlmZmZmZmZmZmZm	Z	m
Z
mZ d dlmZ d dlmZmZmZmZmZ d dlmZmZmZ  e
deeeeeef         eeef                   Z e
deeee         ee          Z e
de	eef         ee                   Ze j        deeeef         d	ed         fd
            Zdeegef         d	eegef         fdZdeeegef         d	eeegef         fdZ deeegef         d	eeegef         fdZ!deeegef         d	eeegef         fdZ"deeegef         d	eeegef         fdZ#deeeeef         gef         d	eeeeef         gef         fdZ$dS )    N)	AnyCallableDictIteratorListOptionalTupleTypeVarUnion)BackendIndexDispatchKeyNativeFunctionNativeFunctionsGroupNativeFunctionsViewGroup)contextSTFF2F3greturnc              #   R  K   t          | t                    r| j        nt          | t                    r| j        n| t          fd          5  t          j        j        j	                  5  d V  d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )Nc                  (    d j          d j         S )Nzin native_functions.yaml line z:
  )locfunc)fs   P/var/www/html/auto_sub_bot/venv/lib/python3.11/site-packages/torchgen/context.py<lambda>z)native_function_manager.<locals>.<lambda>6   s    N!%NNafNN     )!use_const_ref_for_mutable_tensorsuse_ilistref_for_tensor_lists)

isinstancer   outr   viewr   localparametrizer!   part_of_structured_group)r   r   s    @r   native_function_managerr)   '   sH      !)** 

 E	A/	0	0 F	NNNN	O	O  ./.Q*+*D
 
 
 	 	 EEE		 	 	 	 	 	 	 	 	 	 	 	 	 	 	                 s6   !B3B8BB	BB	BB #B r   c                 d     t          j                   dt          dt          f fd            }|S )Nr   r   c                 l    t          |           5   |           cd d d            S # 1 swxY w Y   d S Nr)   )r   r   s    r   wrapperz%with_native_function.<locals>.wrapperD   s    $Q'' 	 	477	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   )--)	functoolswrapsr   r   r   r.   s   ` r   with_native_functionr2   C   sK    _T1        Nr    c                 r     t          j                   dt          dt          dt          f fd            }|S )Nr   f2r   c                 n    t          |           5   | |          cd d d            S # 1 swxY w Y   d S r,   r-   )r   r4   r   s     r   r.   z)with_native_function_and.<locals>.wrapperM   s     %Q'' 	 	42;;	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	   *..)r/   r0   r   r   r   r1   s   ` r   with_native_function_andr7   L   sR    _T1 "       
 Nr    c                 r     t          j                   dt          dt          dt          f fd            }|S )Nslfr   r   c                 n    t          |          5   | |          cd d d            S # 1 swxY w Y   d S r,   r-   r9   r   r   s     r   r.   z,method_with_native_function.<locals>.wrapperW   s    $Q'' 	  	 4Q<<	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	 r6   )r/   r0   r   r   r   r1   s   ` r   method_with_native_functionr<   V   sR    _T Q  1               Nr    c                 r     t          j                   dt          dt          dt          f fd            }|S )Nr9   r   r   c                 z    t          |d                   5   | |          cd d d            S # 1 swxY w Y   d S )Nr   r-   r;   s     r   r.   z3method_with_nested_native_function.<locals>.wrapperb   s    $QqT** 	  	 4Q<<	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	 s   044)r/   r0   r   r   r   r1   s   ` r   "method_with_nested_native_functionr?   _   sT     _T Q  2  !             Nr    c                 r     t          j                   dt          dt          dt          f fd            }|S )Nr   backend_indexr   c                 n    t          |           5   | |          cd d d            S # 1 swxY w Y   d S r,   r-   )r   rA   r   s     r   r.   z/with_native_function_and_index.<locals>.wrappero   s    $Q'' 	* 	*4=))	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	*r6   )r/   r0   r   r   r   r1   s   ` r   with_native_function_and_indexrC   l   sT     _T*1 *\ *a * * * * * * Nr    c                      t          j                   dt          dt          t          t
          f         dt          f fd            }|S )Nr   backend_indicesr   c                 n    t          |           5   | |          cd d d            S # 1 swxY w Y   d S r,   r-   )r   rE   r   s     r   r.   z1with_native_function_and_indices.<locals>.wrapper{   s    $Q'' 	, 	,4?++	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	,r6   )r/   r0   r   r   r   r   r   r1   s   ` r    with_native_function_and_indicesrG   x   s^     _T,1 ,tK,E'F ,1 , , , , , , Nr    )%
contextlibr/   typingr   r   r   r   r   r   r	   r
   r   torchgen.localr&   torchgen.modelr   r   r   r   r   torchgen.utilsr   r   r   r   boolstrr   r   contextmanagerr)   r2   r7   r<   r?   rC   rG    r    r   <module>rQ      s6           W W W W W W W W W W W W W W W W W W W W W W                    ) ( ( ( ( ( ( ( ( ( G	..
./	.2
23  W^  WT5,-tN/CDD !#;^KLd^   6xQ/ HaS!V4D    8QGQJ#7 HaWaZ<P    h1vqy&9 h1vqy>Q    
Ar7A:
q"gqj   
A|$a'
(q,"#   
AtK567:
;q${L012A56     r    