
    3j                        S r SSKJr  SSKJrJr  / SQr " S S\5      r " S S\5      r	 " S	 S
\5      r
 " S S\5      r " S S\5      r " S S\5      rg)z6Custom exception classes for Kornia validation checks.    )annotations)AnyOptional)	BaseErrorDeviceError
ImageError
ShapeErrorTypeCheckErrorValueCheckErrorc                      \ rS rSrSrSrg)r   "   z+Base exception class for all Kornia errors. N__name__
__module____qualname____firstlineno____doc____static_attributes__r       P/home/wildlama/miniconda3/lib/python3.13/site-packages/kornia/core/exceptions.pyr   r   "   s    5r   r   c                  D   ^  \ rS rSrSrSSS.     SU 4S jjjrSrU =r$ )r	   (   zRaised when tensor shape validation fails.

Attributes:
    actual_shape: The actual shape of the tensor that failed validation.
    expected_shape: The expected shape specification.
N)actual_shapeexpected_shapec               <   > [         TU ]  U5        X l        X0l        g N)super__init__r   r   )selfmessager   r   	__class__s       r   r   ShapeError.__init__0        	!(,r   )r!   strr   z%Optional[tuple[int, ...] | list[int]]r   z%Optional[list[str] | tuple[int, ...]]r   r   r   r   r   r   r   __classcell__r"   s   @r   r	   r	   (   s7     ?C@D	-	- <		-
 >	- 	-r   r	   c                  D   ^  \ rS rSrSrSSS.     SU 4S jjjrSrU =r$ )r
   <   zRaised when type validation fails.

Attributes:
    actual_type: The actual type that failed validation.
    expected_type: The expected type.
N)actual_typeexpected_typec               <   > [         TU ]  U5        X l        X0l        g r   )r   r   r+   r,   )r    r!   r+   r,   r"   s       r   r   TypeCheckError.__init__D   s     	!&*r   )r!   r%   r+   zOptional[type]r,   z!Optional[type | tuple[type, ...]]r&   r(   s   @r   r
   r
   <   s6     '+;?	+	+ $		+
 9	+ 	+r   r
   c                  D   ^  \ rS rSrSrSSS.     SU 4S jjjrSrU =r$ )r   P   zRaised when value/range validation fails.

Attributes:
    actual_value: The actual value that failed validation.
    expected_range: The expected value range (min, max).
N)actual_valueexpected_rangec               <   > [         TU ]  U5        X l        X0l        g r   )r   r   r1   r2   )r    r!   r1   r2   r"   s       r   r   ValueCheckError.__init__X   r$   r   )r!   r%   r1   Optional[Any]r2   zOptional[tuple[Any, Any]]r&   r(   s   @r   r   r   P   s6     '+48	-	- $		-
 2	- 	-r   r   c                  D   ^  \ rS rSrSrSSS.     SU 4S jjjrSrU =r$ )r   d   zRaised when device mismatch validation fails.

Attributes:
    actual_devices: The actual device(s) that failed validation.
    expected_device: The expected device.
N)actual_devicesexpected_devicec               <   > [         TU ]  U5        X l        X0l        g r   )r   r   r8   r9   )r    r!   r8   r9   r"   s       r   r   DeviceError.__init__l   s     	!,.r   )r!   r%   r8   zOptional[list]r9   r5   r&   r(   s   @r   r   r   d   s6     *.)-	/	/ '		/
 '	/ 	/r   r   c                      \ rS rSrSrSrg)r   x   z,Raised when image-specific validation fails.r   Nr   r   r   r   r   r   x   s    6r   r   N)r   
__future__r   typingr   r   __all__	Exceptionr   r	   r
   r   r   r   r   r   r   <module>rB      s_   $ = "  		 	- -(+Y +(-i -(/) /(	 	r   