
    '}h              
       F   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$y)    N)	AnyCallableDictIteratorListOptionalTupleTypeVarUnion)BackendIndexDispatchKeyNativeFunctionNativeFunctionsGroupNativeFunctionsViewGroup)contextSTFF2F3greturnc              #   T  K   t        | t              r| j                  nt        | t              r| j                  n| t        fd      5  t        j                  j                  j                        5  d  d d d        d d d        y # 1 sw Y   xY w# 1 sw Y   y xY ww)Nc                  <    d j                    d j                   S )Nzin native_functions.yaml line z:
  )locfunc)fs   O/var/www/html/test/engine/venv/lib/python3.12/site-packages/torchgen/context.py<lambda>z)native_function_manager.<locals>.<lambda>6   s    9!%%affX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)   '   s      !)*
 EE	A/	0FF	N	O ./.Q.Q*+*D*D
 	 		 	 	 s6   AB(,B:B?B	B(B	BB%!B(r   c                 \     t        j                         dt        dt        f fd       }|S )Nr   r   c                 V    t        |       5   |       cd d d        S # 1 sw Y   y xY wNr)   )r   r   s    r   wrapperz%with_native_function.<locals>.wrapperD   s'    $Q' 	7	 	 	s   ()	functoolswrapsr   r   r   r.   s   ` r   with_native_functionr2   C   s3    __T1    Nr    c                 h     t        j                         dt        dt        dt        f fd       }|S )Nr   f2r   c                 X    t        |       5   | |      cd d d        S # 1 sw Y   y xY wr,   r-   )r   r4   r   s     r   r.   z)with_native_function_and.<locals>.wrapperM   s+     %Q' 	2;	 	 	   	 ))r/   r0   r   r   r   r1   s   ` r   with_native_function_andr7   L   s:    __T1 "   
 Nr    c                 h     t        j                         dt        dt        dt        f fd       }|S )Nslfr   r   c                 X    t        |      5   | |      cd d d        S # 1 sw Y   y xY wr,   r-   r9   r   r   s     r   r.   z,method_with_native_function.<locals>.wrapperW   s)    $Q' 	 Q<	  	  	 r6   )r/   r0   r   r   r   r1   s   ` r   method_with_native_functionr<   V   s:    __T Q  1       Nr    c                 h     t        j                         dt        dt        dt        f fd       }|S )Nr9   r   r   c                 ^    t        |d         5   | |      cd d d        S # 1 sw Y   y xY w)Nr   r-   r;   s     r   r.   z3method_with_nested_native_function.<locals>.wrapperb   s-    $QqT* 	 Q<	  	  	 s   	#,)r/   r0   r   r   r   r1   s   ` r   "method_with_nested_native_functionr?   _   s<     __T Q  2  !     Nr    c                 h     t        j                         dt        dt        dt        f fd       }|S )Nr   backend_indexr   c                 X    t        |       5   | |      cd d d        S # 1 sw Y   y xY wr,   r-   )r   rA   r   s     r   r.   z/with_native_function_and_index.<locals>.wrappero   s*    $Q' 	*=)	* 	* 	*r6   )r/   r0   r   r   r   r1   s   ` r   with_native_function_and_indexrC   l   s<     __T*1 *\ *a * * Nr    c                      t        j                         dt        dt        t        t
        f   dt        f fd       }|S )Nr   backend_indicesr   c                 X    t        |       5   | |      cd d d        S # 1 sw Y   y xY wr,   r-   )r   rE   r   s     r   r.   z1with_native_function_and_indices.<locals>.wrapper{   s*    $Q' 	,?+	, 	, 	,r6   )r/   r0   r   r   r   r   r   r1   s   ` r    with_native_function_and_indicesrG   x   sF     __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      s     W W W   ) ( 	..
./	.2
23 ^ T5,-tN/C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    