
    9i                        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       Q/var/www/html/land-doc-ocr/venv/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                   > Ub  SU SU SU S3nO"UR                  S5      (       a
  SU SU S3nOSn[        TU ]	  U5        g )NzExporting the operator 'z' to ONNX opset version zB is not supported. Support for this operator was added in version z!, try exporting with this version)zaten::zprim::zquantized::z is not supportedzONNX export failed on an operator with unrecognized namespace {op_name}. If you are trying to export a custom operator, make sure you registered it with the right domain and version.)
startswithsuper__init__)selfnameversionsupported_versionmsg	__class__s        r   r   !UnsupportedOperatorError.__init__!   s{    (*4&0H	 RT$%%FH 
 __@AA*4&0H	 R# # 0  	r   r   )r   strr    intr!   z
int | Noner   r   r   r   r   r   r   __classcell__r#   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   7   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>M   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r0   r1   )r3   r4   outputs      r   r6   r7   V   s4      "-N	 $A3b	&++-K-Nr8   z    zv Failed to obtain its input and output for debugging. Please refer to the TorchScript graph for debugging information.)r2   nodekindsourceRangetextwrapindentjoin	enumerateinputsoutputsAttributeErrorr   r   )r   r"   valuemessagecode_locationr#   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   )r"   r%   rE   z_C.Valuer'   r)   s   @r   r   r   7   s    5)" )"r   r   )r   
__future__r   __all__r>   typingr   torchr   UserWarningr   RuntimeErrorr   r   r   r   r   r   <module>rO      sV     "    )+ )^ ^0 6."* ."r   