Ë
    úÍ:jˆ  ã                  ó˜   — d Z ddlmZ g d¢ZddlZddlmZ erddlmZ  G d„ de	«      Z
 G d	„ d
e«      Z G d„ de«      Z G d„ de«      Zy)zONNX exporter exceptions.é    )Úannotations)ÚOnnxExporterWarningÚSymbolicValueErrorÚUnsupportedOperatorErrorN)ÚTYPE_CHECKING)Ú_Cc                  ó   — e Zd ZdZy)r   zWarnings in the ONNX exporter.N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úf/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/torch/onnx/errors.pyr   r      s   „ Ú(r   r   c                  ó   — e Zd ZdZy)ÚOnnxExporterErrorzSErrors raised by the ONNX exporter. This is the base class for all exporter errors.Nr
   r   r   r   r   r      s   „ Ú]r   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   z7Raised when an operator is unsupported by the exporter.c                ó|   •— |�d|› d|› d|› d�}n|j                  d«      r
d|› d|› d�}nd}t        ‰| �	  |«       y )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 supportedz¶ONNX 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   z!UnsupportedOperatorError.__init__!   sx   ø€ ØÐ(à*¨4¨&Ð0HÈÈ	ð RTà$Ð%Ð%FðHñ ð
 �_‰_Ð@ÔAà*¨4¨&Ð0HÈÈ	ð R#ð #ñ ð0ð ô 	‰Ñ˜Õr   )r   Ústrr   Úintr   z
int | None©r   r   r   r   r   Ú__classcell__©r   s   @r   r   r      s   ø„ ÙA÷ñ r   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   z+Errors around TorchScript values and nodes.c                ó`  •— |› d|› d|j                  «       › d|j                  «       j                  «       › d�}|j                  «       j                  «       }|r	|d|› d�z  }	 |dz  }|t	        j
                  dd	j                  d
„ t        |j                  «       j                  «       «      D «       «      xs dz   d	z   dz   d	j                  d„ t        |j                  «       j                  «       «      D «       «      xs dz   d«      z  }t        ‰| �1  |«       y # t        $ r |dz  }Y Œ w xY w)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  óV   K  — | ]!  \  }}d |› d|› d|j                  «       › d�–— Œ# y­w©z    #z: z	  (type 'z')N©Útype)Ú.0ÚiÚinput_s      r   ú	<genexpr>z.SymbolicValueError.__init__.<locals>.<genexpr>M   ó7   è ø€ ò "á )  6ð $ A 3 b¨¨°	¸&¿+¹+»-¸ÈÔKñ"ùó   ‚')z	    Emptyz	Outputs:
c              3  óV   K  — | ]!  \  }}d |› d|› d|j                  «       › d�–— Œ# y­wr)   r*   )r,   r-   Úoutputs      r   r/   z.SymbolicValueError.__init__.<locals>.<genexpr>V   r0   r1   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   r   ÚvalueÚmessageÚcode_locationr   s        €r   r   zSymbolicValueError.__init__<   s\  ø€ àˆeÐ+¨E¨7°)¸E¿J¹J»L¸>ð J@Ø@EÇ
Á
Ã×@QÑ@QÓ@SÐ?TÐTXðZð 	ð
 Ÿ
™
›×0Ñ0Ó2ˆÙØÐ0°°¸qÐAÑAˆGð	à�vÑˆGØ”x—‘ààŸ	™	ñ "ä-6°u·z±z³|×7JÑ7JÓ7LÓ-Mô"ó ò 'ð 'ñð ñð #ñ	#ð Ÿ	™	ñ "ä-6°u·z±z³|×7KÑ7KÓ7MÓ-Nô"ó ò 'ð 'ñð$ ó)ñ ˆGô8 	‰Ñ˜Õ!øô ò 	ØðSñŠGð	ús   Á$B(D ÄD-Ä,D-)r   r   r>   z_C.Valuer!   r#   s   @r   r   r   7   s   ø„ Ù5÷)"ñ )"r   r   )r   Ú
__future__r   Ú__all__r7   Útypingr   Útorchr   ÚUserWarningr   ÚRuntimeErrorr   r   r   r   r   r   ú<module>rG      sV   ðÙ å "ò€ó Ý  ñ Ýô)˜+ô )ô^˜ô ^ôÐ0ô ô6."Ð*õ ."r   