
    h^	                    :    S SK Jr  S SKrS SKJr   " S S\5      rg)    )annotationsN)OpRunc                  <    \ rS rSrS rSS jr    S S	S jjrSrg)
If   c                    [         R                  " XU5        SU R                  ;  a  [        S5      eSU;  a  [        S5      eg )Nopsetsz&run_params must contains key 'opsets'.verbosez'run_params must contains key 'verbose'.)r   __init__
run_paramsKeyError)self	onnx_noder   s      R/var/www/fran/franai/venv/lib/python3.13/site-packages/onnx/reference/ops/op_if.pyr   If.__init__   sA    t
34??*CDDJ&DEE '    c                    g)z
Tells the runtime if this node needs the context
(all the results produced so far) as it may silently access
one of them (operator Loop).
The default answer is `False`.
T )r   s    r   need_contextIf.need_context   s     r   Nc                Z   UR                   S:w  a0  [        SU R                  R                  < S[	        U5       S35      eUR                  S5      nU(       a@  U R                  SU5        U R                  X%S9nU R                  S5        [        U5      nS	n	O?U R                  S
U5        U R                  X%S9nU R                  S5        [        U5      nSn	U(       d$  [        SU R                  R                  < S35      e[        U5       H  u  pUb  M
  U	S	:X  a  U R                  OU R                  nUR                  nUR                  R                   R"                   V
s/ s H  oR                  PM     nn
[        SW
< SU	< SX   < S[%        U5       SU S35      e   U$ s  sn
f )N   zOperator If (zC) expects a single element as condition, but the size of 'cond' is .r   z  -- then> {%r})
attributesz
  -- then<thenz  -- else> {%r}z
  -- else<elsez) does not have any output.zOutput z	 (branch=z, name=z) is None, available inputs=z, initializers=)size
ValueErrorr   namelenitem_log_run_then_branchtuple_run_else_branchRuntimeError	enumeratethen_branchelse_branchoutput_namesobjgraphinitializersorted)r   condcontextr)   r(   r   cond_outputsfinalbranchifbrnamesinitss                  r   _runIf._run   s    99> 3 366yz}  C  {D  zE  EF  G  		!II'1++G+KGIIl#'NEFII'1++G+KGIIl#'NEF 3 366QR  e$DAy)/6)9T%%t?O?O)+)A)AB)AA)AB"aU)F:WUXL I((.w'8waQ  %  Cs   $F(r   )returnbool)NNNN)r/   znp.ndarray | np.bool_)__name__
__module____qualname____firstlineno__r   r   r:   __static_attributes__r   r   r   r   r      s-    F '#' 'r   r   )
__future__r   numpynponnx.reference.op_runr   r   r   r   r   <module>rG      s   
 #  '8 8r   