
    ϑi3                       S SK Jr  S SKrS SKJr  SSKJr  \(       a  SSK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 " 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 " S, S-\	5      r " S. S/\	5      r " S0 S1\	5      r " S2 S3\5      r " S4 S5\5      r  " S6 S7\ 5      r! " S8 S9\5      r" " S: S;\"5      r# " S< S=\5      r$S> r% " S? S@\5      r& " SA SB5      r' " SC SD\5      r( " SE SF\(5      r) " SG SH\)5      r* " SI SJ\)5      r+ " SK SL\(5      r, " SM SN\,5      r- " SO SP\,5      r. " SQ SR\,5      r/ " SS ST\(5      r0 " SU SV\05      r1 " SW SX\(5      r2 " SY SZ\25      r3 " S[ S\\25      r4 " S] S^\(5      r5 " S_ S`\55      r6 " Sa Sb\(5      r7 " Sc Sd\75      r8 " Se Sf\85      r9 " Sg Sh\(5      r: " Si Sj\:5      r; " Sk Sl\:5      r< " Sm Sn\:5      r= " So Sp\:5      r> " Sq Sr\:5      r? " Ss St\:5      r@ " Su Sv\:5      rA " Sw Sx5      rBg)y    )annotationsN)TYPE_CHECKING   )BreakGraphReasonInfo   )VariableBasec                  0    \ rS rSrSr  SS jrSS jrSrg)	BreakGraphReasonBase   zBase class for representing reasons why graph execution was interrupted.

Attributes:
    reason_str (str): Description of the break reason
    file_path (str): Path to the file where break occurred
    line_number (int): Line number where break occurred
c                (    Xl         X l        X0l        g N
reason_str	file_pathline_number)selfr   r   r   s       _/var/www/html/banglarbhumi/venv/lib/python3.13/site-packages/paddle/jit/sot/utils/exceptions.py__init__BreakGraphReasonBase.__init__"   s     %"&    c                    U R                    $ r   )r   )r   s    r   __repr__BreakGraphReasonBase.__repr__,   s    //"#r   )r   r   r   N) )returnstr)__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes__ r   r   r
   r
      s     	'$r   r
   c                      \ rS rSrSrg)DataDependencyBreak0   r$   Nr   r   r    r!   r#   r$   r   r   r&   r&   0       r   r&   c                  0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )DataDependencyControlFlowBreak4   z(Break reason for control flow execution.c                2   > Uc  Sn[         TU ]  UUU5        g )NzAOpcodeInlineExecutor want break graph when simulate control flow.superr   r   r   r   r   	__class__s       r   r   'DataDependencyControlFlowBreak.__init__7   s$    \J	
r   r$   )Nr   r   r   r   r    r!   r"   r   r#   __classcell__r1   s   @r   r+   r+   4   s    2
 
r   r+   c                      \ rS rSrSrg)DataDependencyDynamicShapeBreakB   r$   Nr(   r$   r   r   r7   r7   B   r)   r   r7   c                      \ rS rSrSrg)DataDependencyOperationBreakF   r$   Nr(   r$   r   r   r:   r:   F   r)   r   r:   c                  :   ^  \ rS rSrSSSSSSS.U 4S jjrSrU =r$ )UnsupportedOperationBreakJ   Nr   r   )	left_type
right_typeoperatorr   r   r   c               B   > Uc  SU SU SU 3n[         TU ]  XEU5        g )NzUnsupported operator 'z
' between z and r.   )r   r?   r@   rA   r   r   r   r1   s          r   r   "UnsupportedOperationBreak.__init__K   s5     1(:i[PUV`UabJ<r   r$   r   r   r    r!   r   r#   r4   r5   s   @r   r=   r=   J   s!     = =r   r=   c                  6   ^  \ rS rSrSSSSS.U 4S jjrSrU =r$ )UnsupportedPaddleAPIBreakZ   Nr   r   fn_namer   r   r   c               4   > Uc  SU 3n[         TU ]  UUUS9  g )NzNot support Paddlepaddle API: r   r.   r   rI   r   r   r   r1   s        r   r   "UnsupportedPaddleAPIBreak.__init__[   s2     9'CJ!# 	 	
r   r$   rD   r5   s   @r   rF   rF   Z        
 
r   rF   c                  6   ^  \ rS rSrSSSSS.U 4S jjrSrU =r$ )UnsupportedNumPyAPIBreakm   Nr   r   rH   c               4   > Uc  SU 3n[         TU ]  UUUS9  g )NzNot support NumPy API: r   r.   rK   s        r   r   !UnsupportedNumPyAPIBreak.__init__n   s2     27)<J!# 	 	
r   r$   rD   r5   s   @r   rO   rO   m   rM   r   rO   c                  6   ^  \ rS rSrSSSSS.U 4S jjrSrU =r$ )UnsupportedRandomAPIBreak   Nr   r   rH   c               6   > Uc  SU S3n[         TU ]  UUUS9  g )NzRandom function z is not supported.r   r.   rK   s        r   r   "UnsupportedRandomAPIBreak.__init__   s5     +G94FGJ!# 	 	
r   r$   rD   r5   s   @r   rT   rT      rM   r   rT   c                  4   ^  \ rS rSrSSSS.U 4S jjrSrU =r$ )
ForceBreak   Nr   r   r   c               .   > Uc  Sn[         TU ]  UUUS9  g )NzForce break graph executionr   r.   r0   s       r   r   ForceBreak.__init__   s+     6J!# 	 	
r   r$   rD   r5   s   @r   rY   rY      s     
 
r   rY   c                  <   ^  \ rS rSrSrSSSSSS.U 4S jjrSrU =r$ )	BuiltinFunctionBreak   a$  Break reason for unsupported built-in function calls.

Args:
    fn_name (str): Name of the builtin function
    arg_types (list): Types of the arguments passed to the function
    file_path (str): Path to the file where break occurred
    line_number (int): Line number where break occurred
Nr   r   )rI   	arg_typesr   r   r   c               <   > Uc	  SU SU S3n[         TU ]  UUUS9  g )NzNot support builtin function: z with args: Args()r   r.   )r   rI   r`   r   r   r   r1   s         r   r   BuiltinFunctionBreak.__init__   s>     9'BST]S^^_`J!# 	 	
r   r$   r3   r5   s   @r   r^   r^      s#     
 
r   r^   c                      \ rS rSrSrg)SideEffectBreak   r$   Nr(   r$   r   r   re   re      r)   r   re   c                      \ rS rSrSrg)UnsupportedIteratorBreak   r$   Nr(   r$   r   r   rh   rh      r)   r   rh   c                      \ rS rSrSrg)InlineCallBreak   r$   Nr(   r$   r   r   rk   rk      r)   r   rk   c                      \ rS rSrSrg)FallbackInlineCallBreak   r$   Nr(   r$   r   r   rn   rn      r)   r   rn   c                      \ rS rSrSrg)BreakGraphInlineCallBreak   r$   Nr(   r$   r   r   rq   rq      r)   r   rq   c                      \ rS rSrSrg)OtherInlineCallBreak   r$   Nr(   r$   r   r   rt   rt      r)   r   rt   c                      \ rS rSrSrg)"DygraphInconsistentWithStaticBreak   r$   Nr(   r$   r   r   rw   rw      r)   r   rw   c                      \ rS rSrSrg)PsdbBreakReason   r$   Nr(   r$   r   r   rz   rz      r)   r   rz   c                      \ rS rSrSrSrg)InferMetaBreak   z5Break reason during meta information inference phase.r$   N)r   r   r    r!   r"   r#   r$   r   r   r}   r}      s    ?r   r}   c                  2   ^  \ rS rSrSSS.U 4S jjrSrU =r$ )NullMetaBreak   r   r   )r   r   c               &   > [         TU ]  SX5        g )NzAccess attribute from null metar.   )r   r   r   r1   s      r   r   NullMetaBreak.__init__   s     	-y	
r   r$   rD   r5   s   @r   r   r      s     	
 
r   r   c                  .   ^  \ rS rSrU 4S jrS rSrU =r$ )SotErrorBase   c                   > [         TU ]  " U0 UD6  SSKJn  U" 5       R	                  U R
                  R                   5        g )Nr   )BreakpointManager)r/   r   opcode_translator.breakpointr   on_eventr1   r   )r   argskwargsr   r1   s       r   r   SotErrorBase.__init__   s6    $)&)D$$(?(?'@Br   c                x    [         R                  " U R                  5      n[        SR	                  U5      5        g )Nr   )	traceback	format_tb__traceback__printjoin)r   liness     r   r   SotErrorBase.print   s(    ##D$6$67bggenr   r$   )r   r   r    r!   r   r   r#   r4   r5   s   @r   r   r      s    C r   r   c                      \ rS rSrSrg)
InnerError   r$   Nr(   r$   r   r   r   r      r)   r   r   c                      \ rS rSrSrg)HasNoAttributeErrori  r$   Nr(   r$   r   r   r   r     r)   r   r   c                  ,   ^  \ rS rSrSU 4S jjrSrU =r$ )FallbackErrori  c                0   > [         TU ]  U5        X l        g r   )r/   r   disable_eval_frame)r   msgr   r1   s      r   r   FallbackError.__init__	  s    "4r   )r   )FrD   r5   s   @r   r   r     s    5 5r   r   c                      \ rS rSrSrg)ConditionalFallbackErrori  r$   Nr(   r$   r   r   r   r     s    sr   r   c                  0   ^  \ rS rSrSSU 4S jjjrSrU =r$ )BreakGraphErrori  c                   > [         TU ]  [        U5      5        [        U[        5      (       d  [        S5      eXl        [        R                  " U5        g )Nz1reason must be a subclass of BreakGraphReasonBase)	r/   r   r   
isinstancer
   
ValueErrorreasonr   collect_break_graph_reason)r   r   r1   s     r   r   BreakGraphError.__init__  sG    V%&"677C  77?r   )r   r   )r   r
   rD   r5   s   @r   r   r     s    	@ 	@r   r   c                   ^ ^ U U4S jnU$ )zEWrap function and an error handling function and throw an InnerError.c                    >  T" U 0 UD6$ ! [          a  nUeS nAf[         aW  nT" U 0 UD6nSR                  [        R                  " [        U5      X"R                  5      5      n[        U SU 35      UeS nAff = f)N
z
Origin Exception is: 
 )r   	Exceptionr   r   format_exceptiontyper   r   )r   r   emessageorigin_exception_messagefunc
message_fns        r   impl)inner_error_default_handler.<locals>.impl"  s    	((( 	G 	 $1&1G'+yy**47AG($ )56N5OP	s    
A;A;AA66A;r$   )r   r   r   s   `` r   inner_error_default_handlerr     s     Kr   c                      \ rS rSrSrg)ExportErrori3  r$   Nr(   r$   r   r   r   r   3  r)   r   r   c                  f    \ rS rSrSrSS.SS jjrSS jrSS jr\SS j5       r	\SS	 j5       r
Srg
)SotExtraInfoi7  __SOT_EXTRA_INFO__Fneed_breakgraphc                   Xl         g r   r   r   r   s     r   r   SotExtraInfo.__init__:      .r   c                    Xl         g r   r   r   s     r   set_need_breakgraph SotExtraInfo.set_need_breakgraph=  r   r   c                :    [        U[        R                  U 5        g r   )setattrr   SOT_EXTRA_INFO_ATTR_NAME)r   errs     r   attachSotExtraInfo.attach@  s    \::DAr   c                     [        5       $ r   )r   r$   r   r   defaultSotExtraInfo.defaultC  s
    ~r   c                    [        U [        R                  [        R                  5       5      n[	        U [        R                  U5        U$ r   )getattrr   r   r   r   )r   infos     r   from_exceptionSotExtraInfo.from_exceptionG  s;    668L8L8N
 	\::DAr   N)r   bool)r   BaseException)r   r   )r   r   r   r   )r   r   r    r!   r   r   r   r   staticmethodr   r   r#   r$   r   r   r   r   7  sC    327 //B    r   r   c                      \ rS rSrSrg)SotCapturedExceptioniP  r$   Nr(   r$   r   r   r   r   P  s     r   r   c                      \ rS rSrSrg)SotCapturedLookupErroriW  r$   Nr(   r$   r   r   r   r   W      Cr   r   c                      \ rS rSrSrg)SotCapturedIndexErroriZ  r$   Nr(   r$   r   r   r   r   Z      Sr   r   c                      \ rS rSrSrg)SotCapturedKeyErrori]  r$   Nr(   r$   r   r   r   r   ]      3r   r   c                      \ rS rSrSrg)SotCapturedArithmeticErrori`  r$   Nr(   r$   r   r   r   r   `      r   r   c                      \ rS rSrSrg)SotCapturedFloatingPointErroric  r$   Nr(   r$   r   r   r   r   c  s    r   r   c                      \ rS rSrSrg)SotCapturedOverflowErrorif  r$   Nr(   r$   r   r   r   r   f  s    Cr   r   c                      \ rS rSrSrg)SotCapturedZeroDivisionErrorii  r$   Nr(   r$   r   r   r   r   i  s    r   r   c                      \ rS rSrSrg)SotCapturedImportErroril  r$   Nr(   r$   r   r   r   r   l  r   r   r   c                      \ rS rSrSrg)SotCapturedModuleNotFoundErrorio  r$   Nr(   r$   r   r   r   r   o  s    cr   r   c                      \ rS rSrSrg)SotCapturedRuntimeErrorir  r$   Nr(   r$   r   r   r   r   r  r   r   r   c                      \ rS rSrSrg)SotCapturedNotImplementedErroriu  r$   Nr(   r$   r   r   r   r   u  s    sr   r   c                      \ rS rSrSrg)SotCapturedRecursionErrorix  r$   Nr(   r$   r   r   r   r   x      #r   r   c                      \ rS rSrSrg)SotCapturedNameErrori{  r$   Nr(   r$   r   r   r   r   {  s    #r   r   c                      \ rS rSrSrg)SotCapturedUnboundLocalErrori~  r$   Nr(   r$   r   r   r   r   ~  r   r   r   c                      \ rS rSrSrg)SotCapturedSyntaxErrori  r$   Nr(   r$   r   r   r   r     r   r   r   c                      \ rS rSrSrg)SotCapturedIndentationErrori  r$   Nr(   r$   r   r   r   r     s    3r   r   c                      \ rS rSrSrg)SotCapturedTabErrori  r$   Nr(   r$   r   r   r   r     r   r   r   c                      \ rS rSrSrg)SotCapturedOSErrori  r$   Nr(   r$   r   r   r  r    s    r   r  c                      \ rS rSrSrg)SotCapturedFileExistsErrori  r$   Nr(   r$   r   r   r  r        cr   r  c                      \ rS rSrSrg)SotCapturedFileNotFoundErrori  r$   Nr(   r$   r   r   r  r    r   r   r  c                      \ rS rSrSrg)SotCapturedIsADirectoryErrori  r$   Nr(   r$   r   r   r	  r	    r   r   r	  c                      \ rS rSrSrg)SotCapturedNotADirectoryErrori  r$   Nr(   r$   r   r   r  r    s    r   r  c                      \ rS rSrSrg)SotCapturedPermissionErrori  r$   Nr(   r$   r   r   r  r    r  r   r  c                      \ rS rSrSrg)SotCapturedTimeoutErrori  r$   Nr(   r$   r   r   r  r    r   r   r  c                      \ rS rSrSrg)SotCapturedStopIterationi  r$   Nr(   r$   r   r   r  r    r   r   r  c                      \ rS rSr0 \\_\\_\\	_\
\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\ \!_\"\#_\$\%_\&\'\(\)\*\+\,\-\.\/\0\1\2\3\4\50Er6\7    SS j5       r8\7 S     SS jj5       r9Sr:g)	SotCapturedExceptionFactoryi  c                   [        U[        5      (       a  [        U[        5      (       a  U$ XR                  ;  a8  [        US[        U5      5      n[        SU 3[        40 5      U R                  U'   U R                  U   $ )Nr   SotCaptured)r   r   
issubclassr   MAPPINGr   r   )clsexc_typenames      r   getSotCapturedExceptionFactory.get  s|    
 h%%**+
 +
 O;;&8ZX?D$(dV$';&=r%CKK! {{8$$r   Nc                    UR                   nU R                  U5      nU" UR                  6 nUR                  Ul        UR                  Ul        UR
                  Ul        UR                  Ul        Uc  / nX%l        U$ r   )r1   r  r   	__cause____context____suppress_context__r   tracked_args)r  
origin_excr!  r  new_exc_typenew_excs         r   create"SotCapturedExceptionFactory.create  s{     ''wwx(
0&00(44'1'F'F$ * 8 8 L+r   r$   )r  ztype[Exception]r   ztype[SotCapturedException]r   )r"  r   r!  zlist[VariableBase] | Noner   r   );r   r   r    r!   r   r   LookupErrorr   
IndexErrorr   KeyErrorr   ArithmeticErrorr   FloatingPointErrorr   OverflowErrorr   ZeroDivisionErrorr   ImportErrorr   ModuleNotFoundErrorr   RuntimeErrorr   NotImplementedErrorr   	NameErrorr   UnboundLocalErrorr   SyntaxErrorr   IndentationErrorr   TabErrorr   OSErrorr  FileExistsErrorr  FileNotFoundErrorr  IsADirectoryErrorr	  NotADirectoryErrorr  PermissionErrorr  TimeoutErrorr  StopIterationr  r  classmethodr  r%  r#   r$   r   r   r  r    st   '+ 	) 	%	
 	3 	9 	/ 	7 	+ 	; 	- 	; 	' 	7 	+  	5!" 	%#$ 	#37793-/3G8 %!% 
$% %   37 0 
	 r   r  )C
__future__r   r   typingr   info_collectorr   )opcode_translator.executor.variables.baser   r
   r&   r+   r7   r:   r=   rF   rO   rT   rY   r^   re   rh   rk   rn   rq   rt   rw   rz   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   r   r  r  r  r	  r  r  r  r  r  r$   r   r   <module>rD     s   #    0H$ $.	. 	
%8 
	&9 		#6 	= 4 = 
 9 
&
8 
&
 9 
&
* 
$
4 
:	* 		 		* 		o 		 		? 		)= 		* 		) 		
( 	
	9 		 		* 	5L 5 3} 2
@l 
@(	, 	 2<  81 7 92 8 70 6 <!5 ; E$> D @9 ? D#= C 81 7 B%; A 92 8 C%< B > 7 = 6/ 5 >#7 = 81 7 ?"8 > <5 ; 4- 3 :!3 9 <#5 ; <#5 ; =$6 < :!3 9 70 6 81 7F Fr   