
    IЦi                    t   S SK Jr  S SKrS SKrS SKrS SKJr  S SKJrJ	r	  \R                  R                  S5      S:X  a  \" S5      SS j5       rOSS jr " S	 S
\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      rg)    )annotationsN)	lru_cache)AnyListTORCHINDUCTOR_WRITE_MISSING_OPS1c                    [        [        R                  " 5        S3S5       nUR                  [	        U 5      S-   5        S S S 5        g ! , (       d  f       g = f)Nz/missing_ops.txta
)opentempfile
gettempdirwritestr)targetfds     R/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/torch/_inductor/exc.py_record_missing_opr      sB    X((*++;<cBbHHS[4'( CBBs   A


Ac                    g )N )r   s    r   r   r      s        c                  (    \ rS rSr\SS j5       rSrg)OperatorIssue   c           	         SU  3/[        U5       VVs/ s H  u  p4SU SU 3PM     snn-   nU(       a  UR                  SU 35        [        R                  " SR	                  U5      S5      $ s  snnf )Nztarget: zargs[z]: zkwargs: r   z  )	enumerateappendtextwrapindentjoin)r   argskwargsiargliness         r   operator_strOperatorIssue.operator_str   sw    F8$%.7o)
.=FAeA3c#o)
 
 LL8F8,-tyy/66)
s   A/r   N)r   r   r!   	List[Any]r"   dict[str, Any]returnr   )__name__
__module____qualname____firstlineno__staticmethodr&   __static_attributes__r   r   r   r   r      s    7 7r   r   c                  ,   ^  \ rS rSrSU 4S jjrSrU =r$ )MissingOperatorWithoutDecomp"   c                `   > [        U5        [        TU ]	  SU R                  XU5       35        g )Nzmissing lowering
)r   super__init__r&   selfr   r!   r"   	__class__s       r   r6   %MissingOperatorWithoutDecomp.__init__#   s.    6"-d.?.?f.U-VWXr   r   r   r   r!   r(   r"   r)   r*   Noner+   r,   r-   r.   r6   r0   __classcell__r9   s   @r   r2   r2   "   s    Y Yr   r2   c                  ,   ^  \ rS rSrSU 4S jjrSrU =r$ )MissingOperatorWithDecomp(   c                   > [        U5        [        TU ]	  SU R                  XU5       3[        R
                  " SU S35      -   5        g )Nzmissing decomposition
z9

                There is a decomposition available for z in
                torch._decomp.get_decompositions().  Please add this operator to the
                `decompositions` list in torch._inductor.decomposition
                )r   r5   r6   r&   r   dedentr7   s       r   r6   "MissingOperatorWithDecomp.__init__)   sV    6"%d&7&7f&M%NOoo88>x @
	
r   r   r;   r=   r?   s   @r   rA   rA   (   s    
 
r   rA   c                  @   ^  \ rS rSr          SU 4S jjrSrU =r$ )LoweringException8   c                z   > [         TU ]  [        U5      R                   SU SU R	                  X#U5       35        g )Nz: r   )r5   r6   typer+   r&   )r8   excr   r!   r"   r9   s        r   r6   LoweringException.__init__9   s?     	Cy!!""SED,=,=fF,S+TU	
r   r   )
rK   	Exceptionr   r   r!   r(   r"   r)   r*   r<   r=   r?   s   @r   rG   rG   8   s5    

&)
1:
DR
	
 
r   rG   c                      \ rS rSrSrg)SubgraphLoweringExceptionA   r   Nr+   r,   r-   r.   r0   r   r   r   rO   rO   A       r   rO   c                  ,   ^  \ rS rSrSU 4S jjrSrU =r$ )InvalidCxxCompilerE   c                x   > SSK Jn  [        TU ]  SUR                   SUR
                  R                   35        g )N   )configz!No working C++ compiler found in z
.cpp.cxx: ) rX   r5   r6   r+   cppcxx)r8   rX   r9   s     r   r6   InvalidCxxCompiler.__init__F   s1    //@
6::>>JZ[	
r   r   )r*   r<   r=   r?   s   @r   rT   rT   E   s    
 
r   rT   c                  ,   ^  \ rS rSrSU 4S jjrSrU =r$ )CppWrapperCodegenErrorN   c                *   > [         TU ]  SU 35        g )NzC++ wrapper codegen error: )r5   r6   )r8   msgr9   s     r   r6   CppWrapperCodegenError.__init__O   s    6se<=r   r   )ra   r   r*   r<   r=   r?   s   @r   r^   r^   N   s    > >r   r^   c                  ,   ^  \ rS rSrSU 4S jjrSrU =r$ )CppCompileErrorS   c                   > [        U[        5      (       a  UR                  S5      n[        TU ]  [
        R                  " S5      R                  5       R                  SR                  U5      US95        g )Nzutf-8z
                    C++ compile error

                    Command:
                    {cmd}

                    Output:
                    {output}
                 )cmdoutput)

isinstancebytesdecoder5   r6   r   rD   stripformatr    )r8   rh   ri   r9   s      r   r6   CppCompileError.__init__T   s[    fe$$]]7+FOO
 UWVfV5	
r   r   )rh   z	list[str]ri   r   r*   r<   r=   r?   s   @r   rd   rd   S   s    
 
r   rd   c                      \ rS rSrSrg)CUDACompileErrori   r   NrQ   r   r   r   rq   rq   i   rR   r   rq   )r   r   r*   r<   )
__future__r   osr   r   	functoolsr   typingr   r   environgetr   RuntimeErrorr   r2   rA   rG   rO   rT   r^   rd   rq   r   r   r   <module>rz      s    " 	     ::>>34;t_) )7L 7Y= Y
 
 
 
	 	
 
>\ >

l 
,	 	r   