
    %hJ                     x   d dl mZmZmZmZmZ d dlmZmZm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$  ed e ee"                              Z% ed e ee#                              Z& e$ ee                    Z' e$ ee!                    Z( e e$ ee                              Z) e ee                    Z* e ee#                    Z+ G d de,          Z-dddd	eeee	f                  d
eeee	f                  de.de.dee         f
dZ/dS )    )DictListNoReturnSequenceUnion)ArrayRefCType	BaseCTypeBindingboolTConstRefCTypedeviceTExprintArrayRefTiOptTensorListRefTlayoutT	ListCTypelongTmemoryFormatTMutRefCType
NamedCTypeopmath_tOptionalCTypeoptionalIntArrayRefToptionalScalarRefToptionalSymIntArrayRefToptionalTensorRefTscalar_tscalarTscalarTypeTSpecialArgNamesymIntArrayRefTSymIntTtensorOptionsTtensorTVectorCTypeoptionsoutc                       e Zd ZdS )
UnsatErrorN)__name__
__module____qualname__     V/var/www/html/auto_sub_bot/venv/lib/python3.11/site-packages/torchgen/api/translate.pyr)   r)   K   s        Dr.   r)   F)methodallow_expensive_conversionsbindingsgoalsr0   r1   returnc                  	
 g }| D ][}t          |t                    r/|                    t          |j        |j                             F|                    |           \g 	|D ]G}t          |t                    r	                    |j                   2	                    |           Hi |D ]}|j        |j        <   |j        }t          |t                    rt          |j	        t                    rt          |j	        j	        t                    rtt          |j	        j	        j                  dk    rRd|j         d|j         dt          |j	        j	        j        t          t          t                                        <   |j        t          t          t          t                                        k    rCd|j         d|j         d|j         d	t          |j        t          t                              <   |j        t          t          t                               k    r3d|j         d
t          |j        t          t"                              <   |j        t          t          t          t                                         k    r;d|j         d|j         dt          |j        t          t$                              <   |j        t          t&                    k    r3d|j         dt          |j        t          t"                              <   |j        t          t)          t          t          t                                                  k    r3d|j         dt          |j        t          t*                              <   |rddt          dt-          t          t                                        <   dt          dt          t          t                                        <   dt          dt.          ffddt          dt0          dt          f	
fd

fd	D             S )N)exprtypez
at::Tensor(z.has_value() ? *z : at::Tensor())z((z.has_value() && (*z&).defined()) ? at::OptionalTensorRef(*z) : at::OptionalTensorRef())z).to<opmath_t>()z'.has_value() ? at::OptionalScalarRef(&(z%.value())) : at::OptionalScalarRef())zstatic_cast<opmath_t>()zat::IOptTensorListRef(zconst_cast<Tensor&>(*this)selfgoalr4   c           	          d                     d                                 D                       }t          d|                                  d| j         d| d          )N
c              3   `   K   | ])\  }}d |                                  d|j         d| V  *dS )z   z; // N)cpp_typename).0tes      r/   	<genexpr>z+translate.<locals>.unsat.<locals>.<genexpr>   sZ       
 
59Q00000Q00
 
 
 
 
 
r.   z&
Failed to synthesize the expression "r?   zI".
When I failed, the following bindings were available in the context:

z~

This probably means there is a missing rule in the rules of torchgen.api.translate.
Check this module for more information.
)joinitemsr)   r@   rA   )r;   ctx_descctxs     r/   unsatztranslate.<locals>.unsat   s    99 
 
=@YY[[
 
 
 
 
 &*mmoo 8<	  
	  

 

 
	
r.   directc          
      6   dt           dt          ffd}| v r|          S t          | j        t                    rH	  t          | j        t          | j        j                            |          S # t          $ r Y nw xY wt          | j        t                    r;	  t          | j        | j        j                  |          S # t          $ r Y nw xY w| j        t          t          t                              k    r2 t          | j        t          t                              |          S |r |            | t          dt          t          t                                        k    ry |t          t          j        t          t          t                                                  }t"          v r|S 	  |t"                    }d| d| dS # t          $ r |cY S w xY w| t          d	t          t$                              k    r |t          d
t          t          t&                                                  } |t          dt          t          t(                                                  } |t          dt          t          t*                                                  } |t          dt          t          t,                                                  }d| d| d| d| d	S | t          d
t          t          t&                                        k    r<	  |t"                    }d| dS # t          $ r  |t.                    }	|	 dcY S w xY w| t          dt          t          t,                                        k    r;	  |t"                    }| dS # t          $ r  |t.                    }	|	 dcY S w xY w| t          dt          t          t*                                        k    r;	  |t"                    }| dS # t          $ r  |t.                    }	|	 dcY S w xY w| t          dt          t          t(                                        k    r7	  |t"                    }| dS # t          $ r  |t.                    }	Y dS w xY w| j        t          t                    k    rj	  |t          | j        t0                              S # t          $ r9  |t          | j        t          t2                                        }
d|
 dcY S w xY w| j        t          t2                    k    rj	  |t          | j        t          t                                        }d| dS # t          $ r&  |t          | j        t4                              cY S w xY w| j        t          t6                    k    r0 |t          | j        t          t                                        S | j        t          t          t6                              k    rE |t          | j        t          t          t                                                  }| d| dS | j        t          t                    k    r5 |t          | j        t          t6                                        }| dS | j        t          t          t                              k    rE |t          | j        t          t          t6                                                  }| d | d!S | j        t          t8                    k    rl	  |t          | j        t:                              S # t          $ r;  |t          | j        t          t<                                        }| d"| dcY S w xY w| j        t          t<                    k    r8 |t          | j        t          t8                                        }| d#| dS | j        t          t>                    k    r# |t          | j        t@                              S | j        t          tB                    k    r# |t          | j        tD                              S r| j        tG          t          t                              k    r7t          | j        t          t                              } ||          }| d$S | j        tG          t          t6                              k    r7t          | j        t          t2                              } ||          }| d$S | j        t          tG          t          t                                        k    r:t          | j        t          t8                              } ||          }| d | d%S | j        t          t          tH                              k    r:t          | j        t          t>                              } ||          }| d | d&S | j        t          t          tH                              k    r:t          | j        t          tB                              } ||          }| d | d&S | j        t          t          tJ                              k    rEt          | j        t	          t          tJ                                        } ||          }d'| dS  |            d S )(Nr;   r4   c                      | d          S )NTrK   r-   )r;   solves    r/   direct_solvez.translate.<locals>.solve.<locals>.direct_solve   s    5d++++r.   rN   memory_formatz:c10::impl::check_tensor_options_and_extract_memory_format(z, r9   r&   dtype
pin_memorydevicelayoutzTensorOptions().dtype(z	).layout(z	).device(z).pinned_memory(zoptTypeMetaToScalarType(z.dtype_opt())z.scalar_type()z.layout_opt()z	.layout()z.device_opt()z	.device()z.pinned_memory_opt()zc10::nulloptzC10_AS_INTARRAYREF_SLOW(zc10::fromIntArrayRefSlow(z/.has_value() ? c10::make_optional(c10::SymInt(*z)) : c10::nulloptz.guard_int(__FILE__, __LINE__)z".has_value() ? c10::make_optional(z/->guard_int(__FILE__, __LINE__)) : c10::nulloptz;.has_value() ? c10::make_optional(C10_AS_INTARRAYREF_SLOW(*z<.has_value() ? c10::make_optional(c10::fromIntArrayRefSlow(*z.vec()z->vec()) : c10::nulloptz) : c10::nulloptzconst_cast<Tensor&>()&r   str
isinstancer7   r   rA   r   elemr)   r   r	   r   r   r   r   r     possibly_redundant_memory_formatoptions_ctyper#   r   r   r   r   out_tensor_ctypelongVec_ctyper!   longSymVec_ctyper"   r   optionalLongVec_ctyper   r   optionalScalar_ctyper   optionalTensor_ctyper%   r   r$   )r;   rK   rP   rQ   r&   rR   rS   rT   rU   
out_tensorsymIntArrayRef_typerargnamesymInt_typeintArrayRef_ctypesymIntArrayRef_ctypeoptionalIntArrayRef_ctypeoptionalScalarRef_ctypeoptionalTensorRef_ctypeconst_ref_tensor_ctyper1   rI   goal_ctypesrO   rJ   s                       r/   rO   ztranslate.<locals>.solve   s   	,z 	,c 	, 	, 	, 	, 	, 	, 3;;t9 di// 		 uty+din*E*EFFv        di-- 	uZ	49>BB6RRRR    9i&6&677775DIy/F/FGGPVWWWW 	E$KKK :o}Y}=U=U/V/VWWWW(L"C!)M":":;;  M ++$$%&,}55oT[oo_loooo % % %$$$$%Z	9^+D+DEEEE L7M)K2H2H$I$IJJ E &<y7G7G)H)HII J "\8]9W3E3E%F%FGG F "\8]9W3E3E%F%FGG F sErrFrrVrreorrrrZy7M7M)N)NOOOO5&,}55H'HHHH 5 5 5)\*:;;
$4444445 Z-	'8J8J*K*KLLLL0&,}55!0000 0 0 0)\*:;;
$//////0 Z-	'8J8J*K*KLLLL0&,}55!0000 0 0 0)\*:;;
$//////0 ZmIe<L<L.M.MNNNN&&,}55!7777 & & & *\*:;;
%~~	& Y)L1111I#|Jty-$H$HIII I I I&2lty)O*D*DEE' '# I2EHHHHHHI Y)O4444M LDIy7N7N!O!OPP717777 M M M#|Jty:J$K$KLLLLLMY)G,,,,<
49i6F6F G GHHHY-	'(:(:;;;;"l49mIe4D4D&E&EFF G hhghhhhY)E****&,z$)Yw=O=O'P'PQQK!AAAAY-	%(8(89999"l49mIg4F4F&G&GHH G yyyyyyY)$89999y#|Jty:O$P$PQQQ y y y&,ty)4K*L*LMM  "xx^exxxxxx	y
 Y)$;<<<< #l49i0D&E&EFF G uu[buuuuY)$67777<
496J K KLLLY)$67777<
496J K KLLL ' 	_yK	%(8(89999$.ty)L:Q:Q$R$R!&,'899!))))yK	'(:(:;;;;'1$)Y=W=W'X'X$&,';<<!))))mK	%8H8H,I,IJJJJ,6Iy)=>>- -) ','@AA!eeWeeeemIg,>,>????*4Iy);<<+ +' ','>??!^^W^^^^mIg,>,>????*4Iy);<<+ +' ','>??!^^W^^^^ 9Ig$6$67777%/	=7););<<& &" #l#9::G4'4444ds   6A4 4
B B)C	 	
CCG G+*G+7M M/.M/&N; ;OOP) )Q
QR R54R5"S9 9A T<;T<5V -WW!"^ A_	_	c                 F    g | ]}t           |d           |          S )FrN   )r   )rB   grO   s     r/   
<listcomp>ztranslate.<locals>.<listcomp>  s2    AAADq'''++AAAr.   )rW   r
   appendr   rA   nctyper6   r7   r   rX   r   r	   rV   r   r$   r   r   r   r   r   r   r   r   r   bool)r2   r3   r0   r1   binding_exprsbrn   rC   rI   rl   rO   rJ   s      `    @@@@r/   	translateru   `   s    !#M 	$ 	$a!! 	$          ####$&K " "a!! 	"qx((((q!!!! "$C B3 B3fAF@ Fq-((	E16=11	E 16;	22	E AFK$%%55 EAFDDAFDDD 16;+]9W;M;M-N-NOO 6]=71C1C#D#DEEEE BQV  B  Bqv  B  B]^]c  B  B  B 169-?#@#@AA 6]9W#5#56666;Wqv;W;W;WC
169X#6#67786]=71C1C#D#DEEEE qAFpp16ppp 169-?#@#@AA 6Yx(((( 3222 169X#6#677
 6]9]9W;M;M-N-N#O#OPPPP 3222 169-?#@#@AA
  ) ) 	v{9W+=+=>>??	

 ) 	v}Yw-?-?@@AA	

J 
8 
 
 
 
 
 
.JJ J4 JC J J J J J J J J J JX BAAA[AAAAr.   N)0typingr   r   r   r   r   torchgen.api.typesr   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   rZ   r[   r\   r]   r^   r_   r`   RuntimeErrorr)   rr   ru   r-   r.   r/   <module>ry      s   8 8 8 8 8 8 8 8 8 8 8 8 8 8                                                               z 
9mmIIn4M4M&N&NOO:e]]99W3E3E%F%FGG IIe,,--;yy1122 %kk))E2B2B&C&CDD $}YYw%7%788 $}YYw%7%788 	 	 	 	 	 	 	 	2 (-NB NB NBuT7]+,NBE*g-./NB 	NB
 "&NB 
$ZNB NB NB NB NB NBr.   