
    h                     .    S SK rS SKJr   " S S\5      rg)    N)OpRunc                   :    \ rS rSrS rS rSSSSSSSS.S jrSrg)Scan   c                 D   [         R                  " XU5        [        U R                  S5      (       d"  [	        S[        U R                  5       S35      e[        U R                  5       Vs/ s H:  nU R                  b  U[        U R                  5      :  a  SOU R                  U   PM<     snU l
        [        U R                  5      nUS:w  a  [	        S5      e[        U R                  5       Vs/ s H:  nU R                  b  U[        U R                  5      :  a  SOU R                  U   PM<     snU l        [        U R                  5      nUS:w  a  [	        S5      eU R                  R                  U l        U R                  R                  U l        g s  snf s  snf )Nrunz0Parameter 'body' must have a method 'run', type .r   z@Scan is not implemented for other output input_direction than 0.z4Scan is not implemented for other input axes than 0.)r   __init__hasattrbodyRuntimeErrortyperangenum_scan_inputsscan_input_directionsleninput_directions_maxscan_input_axesinput_axes_input_namesoutput_names)self	onnx_node
run_paramsi
max_dir_in
max_axe_ins         T/var/www/fran/franai/venv/lib/python3.13/site-packages/onnx/reference/ops/op_scan.pyr
   Scan.__init__   s   t
3tyy%((B4		?BSSTU  4//0"

 1 ))1C2233  ++A./ 1"
 //0
?R  4//0	
 1 ##+qC8L8L4M/M %%a() 1	
 ))*
?UVV9900 II22-"

s   ,AF2AFc                    [        U5      U R                  -
  n[        U5      U-
  n[        U5       Vs/ s H:  nU R                  b  U[        U R                  5      :  a  SOU R                  U   PM<     nn[	        U5      nUS:w  a  [        S5      e[        U5       Vs/ s H:  nU R                  b  U[        U R                  5      :  a  SOU R                  U   PM<     nn[	        U5      nUS:w  a  [        S5      eU R                  S U R                   n	U R                  S [        U	5       n
U R                  US  nU R                  US  nXS  nUS U nUUUUUUU	U
UUUU4$ s  snf s  snf )Nr   zAScan is not implemented for other output output_direction than 0.z5Scan is not implemented for other output axes than 0.)	r   r   r   scan_output_directionsr   r   scan_output_axesr   r   )r   argsnum_loop_state_varsnum_scan_outputsr   output_directionsmax_dir_outoutput_axesmax_axe_outstate_names_instate_names_outscan_names_inscan_names_outscan_valuesstatess                  r   _common_run_shapeScan._common_run_shape*   s   !$i$*>*>>t9':: +,

 - **2C3344  ,,Q/0 - 	 
 +,!S  +,	
 - $$,S9N9N5O0O &&q)* -	 	 
 +&!VWW))*@D,@,@A++,Ac..AB(()<)=>**+>+?@/0**+  
 	
=

s   AE% AE*N)r   r   r   r   r#   r"   
attributesc                2   U R                   " U6 u  n	n
nnnnnnnnnnX   R                  U R                  S      nU Vs/ s H  n/ PM     nn[        U5       H  n0 n[	        UU5       H  u  nnUUU'   M     [	        UU5       H  u  nnUU   UU'   M      U R                  U5      n[        [	        U R                  U5      5      nU Vs/ s H  nUU   PM
     nn[        U5       H0  u  nnUU   R                  [        R                  " UU   SS95        M2     M     U H*  n [        R                  " U 5      n!UR                  U!5        M,     [!        U5      $ s  snf ! [         a(  n[        S[        U R                  5       S35      UeS nAff = fs  snf )Nr   zUnable to call 'run' for type 'z'.)axis)r1   shaper   r   zip	_run_body	TypeErrorr   r   dictr   	enumerateappendnpexpand_dimsvstacktuple)"r   r   r   r   r   r#   r"   r3   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   max_iter_resultsitinputsnamevalueoutputs_listeoutputsr   resconcs"                                     r   _run	Scan._run[   s   2 ""D)	
 ,2243C3CA3FG-.~!2~./BF">6:e$t  ;"=+>e$Ryt  ?#~~f5 3t00,?@G0?@gdmF@$^44
!!"..Q"GH 5! "& C99S>DMM$  V}1 /  5d499o5FbI As#   EEF
F)#FF)r   r   r   r   )__name__
__module____qualname____firstlineno__r
   r1   rM   __static_attributes__     r   r   r      s.    3</
h "#4 4rU   r   )numpyr=   onnx.reference.op_runr   r   rT   rU   r   <module>rX      s     'D5 DrU   