
    JTh                        S r SSKJr  / SQrSSK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g)zONNX exporter exceptions.    )annotations)OnnxExporterWarningSymbolicValueErrorUnsupportedOperatorErrorN)TYPE_CHECKING)_Cc                      \ rS rSrSrSrg)r      zWarnings in the ONNX exporter. N__name__
__module____qualname____firstlineno____doc____static_attributes__r       I/var/www/auris/envauris/lib/python3.13/site-packages/torch/onnx/errors.pyr   r      s    (r   r   c                      \ rS rSrSrSrg)OnnxExporterError   zSErrors raised by the ONNX exporter. This is the base class for all exporter errors.r   Nr   r   r   r   r   r      s    ]r   r   c                  0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )r      z7Raised when an operator is unsupported by the exporter.c                X  > SSK Jn  SSKJn  UbO  UR                  R
                  nUR                  XU5      nUR                  XeR                  R                  U5        OUR                  S5      (       aY  UR                  R                  nUR                  XUR                  5      nUR                  XeR                  R                  U5        OMUR                  R                  nUR                  U5      nUR                  XeR                  R                  U5        [        TU ]=  U5        g )Nr   )
_constants)diagnostics)zaten::zprim::zquantized::)
torch.onnxr   torch.onnx._internalr   rules)operator_supported_in_newer_opset_versionformat_messagediagnoselevelsERROR
startswith"missing_standard_symbolic_functionPYTORCH_GITHUB_ISSUES_URL missing_custom_symbolic_functionsuper__init__)	selfnameversionsupported_versionr   r   diagnostic_rulemsg	__class__s	           r   r*   !UnsupportedOperatorError.__init__!   s    )4(!!KK  "00@QRC  2D2D2J2JCPBCC"-"3"3"V"V%44:#G#G $$_6H6H6N6NPST"-"3"3"T"T%44T:$$_6H6H6N6NPSTr   r   )r,   strr-   intr.   z
int | Noner   r   r   r   r   r*   r   __classcell__r1   s   @r   r   r      s    A r   r   c                  0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )r   9   z+Errors around TorchScript values and nodes.c                  > U SU SUR                  5        SUR                  5       R                  5        S3nUR                  5       R                  5       nU(       a	  USU S3-  n US-  nU[        R
                  " SS	R                  S
 [        UR                  5       R                  5       5       5       5      =(       d    S-   S	-   S-   S	R                  S [        UR                  5       R                  5       5       5       5      =(       d    S-   S5      -  n[        TU ]1  U5        g ! [         a    US-  n N!f = f)Nz  [Caused by the value 'z	' (type 'z;') in the TorchScript graph. The containing node has kind 'z'.] z
    (node defined in )z

zInputs:

c              3  Z   #    U  H!  u  pS U SU SUR                  5        S3v   M#     g7fz    #z: z	  (type 'z')Ntype).0iinput_s      r   	<genexpr>.SymbolicValueError.__init__.<locals>.<genexpr>O   s4      "-M	 $A3b	&++-K-M   )+z	    Emptyz	Outputs:
c              3  Z   #    U  H!  u  pS U SU SUR                  5        S3v   M#     g7fr>   r?   )rA   rB   outputs      r   rD   rE   X   s4      "-N	 $A3b	&++-K-NrF   z    zv Failed to obtain its input and output for debugging. Please refer to the TorchScript graph for debugging information.)r@   nodekindsourceRangetextwrapindentjoin	enumerateinputsoutputsAttributeErrorr)   r*   )r+   r0   valuemessagecode_locationr1   s        r   r*   SymbolicValueError.__init__>   s\   e+E7)EJJL> J@@E

@Q@Q@S?TTXZ 	
 

0020qAAG	vGx		 "-6uzz|7J7J7L-M"  ' '  #	# 		 "-6uzz|7K7K7M-N"  ' '$ ) G8 	!  	SG	s   )B3D, ,D>=D>r   )r0   r3   rS   z_C.Valuer5   r7   s   @r   r   r   9   s    5)" )"r   r   )r   
__future__r   __all__rL   typingr   torchr   UserWarningr   RuntimeErrorr   r   r   r   r   r   <module>r]      sV     "    )+ )^ ^0 :."* ."r   