+
     åûjS#  ã                  óö   € R t ^ RIHt ^ RIHtHt ^ RIt. ROt ! R R]4      t	 ! R R	]	]
4      t ! R R]]]4      t ! R R
]	]4      t ! R R]	]
4      t ! R R]]4      t ! R R]	]
4      t ! R R]	]
4      tR# )aÊ  The errors that kornia's input checks raise, each also the built-in exception that matches its failure.

``except BaseError`` catches every one of them. Each subclass also derives from a built-in exception, so the matching
``except`` clause catches it together with the built-in errors that other functions raise. In a call compiled with
``torch.jit.script``, a failed check raises ``torch.jit.Error`` instead, which none of these clauses catches.

Which class to use, by the failure to catch:

- Any failure of a ``KORNIA_CHECK*`` helper: :exc:`BaseError`.
- A shape or a size: :exc:`ShapeError`, a ``ValueError``; an augmentation input with an unsupported number of
  dimensions: :exc:`InputRankError`, a :exc:`ShapeError` that is also a ``RuntimeError`` and an ``AssertionError``.
- A type or a dtype: :exc:`TypeCheckError`, a ``TypeError``.
- A value or a range: :exc:`ValueCheckError`, a ``ValueError``; the host failure of a value check that an accelerator
  runs asynchronously: :exc:`AsyncCheckError`, a :exc:`ValueCheckError` that is also a ``RuntimeError``.
- Tensors on different devices: :exc:`DeviceError`, a ``ValueError``.
- A tensor without the channel layout of an image: :exc:`ImageError`, a ``ValueError``.
)Úannotations)ÚAnyÚOptionalNÚAsyncCheckErrorÚ	BaseErrorÚDeviceErrorÚ
ImageErrorÚInputRankErrorÚ
ShapeErrorÚTypeCheckErrorÚValueCheckErrorc                  ó   € ] tR t^6tRtRtR# )r   a.  Catch every failure of the KORNIA_CHECK helpers with this base class, which KORNIA_CHECK raises.

``except BaseError`` catches it and its subclasses, which the checks and some functions raise. It derives only from
:exc:`Exception`, so neither ``except ValueError`` nor ``except TypeError`` catches it.
© N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   ó    ÚRC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\kornia\core\exceptions.pyr   r   6   s   † õr   c                  ó>   a € ] tR t^>tRtRRRR/R V 3R llltRtV ;t# )r
   aL  Catch a failed shape or size check; also a ValueError.

:func:`~kornia.core.check.KORNIA_CHECK_SHAPE`, :func:`~kornia.core.check.KORNIA_CHECK_SIZES`,
:func:`~kornia.core.check.KORNIA_CHECK_SAME_SIZE`, :func:`~kornia.core.check.KORNIA_CHECK_SAME_SHAPE`,
:func:`~kornia.core.check.KORNIA_CHECK_DM_DESC` and :func:`~kornia.feature.KORNIA_CHECK_LAF` raise it, and so do
functions that check shapes themselves.

Attributes:
    actual_shape: the shape of the tensor that failed validation, or ``None`` when the raiser gives none.
    expected_shape: the expected pattern, sizes or shape, or ``None`` when the raiser gives none.

See Also:
    - :exc:`InputRankError`: the subclass for an augmentation input with an unsupported number of dimensions.
    - :exc:`ImageError`: a tensor without the channel layout of an image, with no shape attributes.
Úactual_shapeNÚexpected_shapec               ó$   € V ^8„  d   QhRRRRRR/# )é   ÚmessageÚstrr   z%Optional[tuple[int, ...] | list[int]]r   z%Optional[list[str] | tuple[int, ...]]r   )Úformats   "r   Ú__annotate__ÚShapeError.__annotate__O   s(   € ÷ 	-ñ 	-àð	-ð <ð		-ð
 >ñ	-r   c               	ó>   <€ \         SV `  V4       W n        W0n        R # ©N)ÚsuperÚ__init__r   r   )Úselfr   r   r   Ú	__class__s   &&$$€r   r%   ÚShapeError.__init__O   ó   ø€ ô 	‰Ñ˜Ô!Ø(ÔØ,Ör   )r   r   ©r   r   r   r   r   r%   r   Ú__classcell__©r'   s   @r   r
   r
   >   s.   ø† ñð 	-ð ?Cð		-ð
 AE÷	-÷ 	-ð 	-r   c                  ó   € ] tR t^[tRtRtR# )r	   a.  Catch an augmentation input with too few or too many dimensions.

The augmentation classes and their containers used to raise :exc:`ValueError`, :exc:`RuntimeError` or
:exc:`AssertionError` for such an input, depending on the entry point (`#4424
<https://github.com/kornia/kornia/issues/4424>`_), so this :exc:`ShapeError`, a :exc:`ValueError`, also derives from
:exc:`RuntimeError` and :exc:`AssertionError`, and each of those ``except`` clauses still catches it.

See Also:
    - :exc:`ShapeError`: the parent class, for every other shape or size failure.
r   Nr   r   r   r   r	   r	   [   ó   † õ	r   c                  ó>   a € ] tR t^htRtRRRR/R V 3R llltRtV ;t# )r   a×  Catch a failed type or dtype check; also a TypeError.

:func:`~kornia.core.check.KORNIA_CHECK_TYPE`, :func:`~kornia.core.check.KORNIA_CHECK_IS_TENSOR` and
:func:`~kornia.core.check.KORNIA_CHECK_IS_LIST_OF_TENSOR` raise it, as does
:func:`~kornia.core.check.KORNIA_CHECK_SAME_DEVICES` for an argument that is not a non-empty list of tensors, and so
do functions that reject a dtype, such as an integer image.

Attributes:
    actual_type: the actual type (or tensor dtype) that failed validation, or ``None`` when the raiser gives none.
    expected_type: the expected type (or tensor dtype), or ``None`` when the raiser gives none.

See Also:
    - :exc:`ValueCheckError`: a value of the right type outside the accepted range.
Úactual_typeNÚexpected_typec               ó$   € V ^8„  d   QhRRRRRR/# )r   r   r   r0   zOptional[type | torch.dtype]r1   z/Optional[type | tuple[type, ...] | torch.dtype]r   )r   s   "r   r    ÚTypeCheckError.__annotate__x   s)   € ÷ 	+ñ 	+àð	+ð 2ð		+ð
 Gñ	+r   c               	ó>   <€ \         SV `  V4       W n        W0n        R # r#   )r$   r%   r0   r1   )r&   r   r0   r1   r'   s   &&$$€r   r%   ÚTypeCheckError.__init__x   s   ø€ ô 	‰Ñ˜Ô!Ø&ÔØ*Ör   )r0   r1   r*   r,   s   @r   r   r   h   s-   ø† ñð	+ð 59ð		+ð
 JN÷	+÷ 	+ð 	+r   c                  ó>   a € ] tR t^„tRtRRRR/R V 3R llltRtV ;t# )r   aš  Catch a failed value or range check; also a ValueError.

:func:`~kornia.core.check.KORNIA_CHECK_IS_IMAGE` raises it for values out of its range, with the ``(min, max)`` of
the image as ``actual_value``, and functions that check values themselves raise it as well.

Attributes:
    actual_value: the actual value that failed validation, or ``None`` when the raiser gives none.
    expected_range: the accepted ``(min, max)``, or ``None`` when the raiser gives none.

See Also:
    - :exc:`AsyncCheckError`: the subclass for the host failure of a value check that accelerators run
      asynchronously.
    - :exc:`TypeCheckError`: a value of the wrong type or dtype.
Úactual_valueNÚexpected_rangec               ó$   € V ^8„  d   QhRRRRRR/# )r   r   r   r7   úOptional[Any]r8   zOptional[tuple[Any, Any]]r   )r   s   "r   r    ÚValueCheckError.__annotate__”   s(   € ÷ 	-ñ 	-àð	-ð $ð		-ð
 2ñ	-r   c               	ó>   <€ \         SV `  V4       W n        W0n        R # r#   )r$   r%   r7   r8   )r&   r   r7   r8   r'   s   &&$$€r   r%   ÚValueCheckError.__init__”   r)   r   )r7   r8   r*   r,   s   @r   r   r   „   s+   ø† ñð	-ð '+ð		-ð
 59÷	-÷ 	-ð 	-r   c                  ó   € ] tR t^ tRtRtR# )r   aå  Catch the host failure of a value check that an accelerator runs as torch._assert_async.

On CUDA, and on MPS from torch 2.13, the same check is not read back on the host: torch raises a :exc:`RuntimeError`
by the next synchronization instead, and on CUDA that is a device-side assert after which the context cannot be
used. This class is also a :exc:`RuntimeError`, so ``except RuntimeError`` catches a failure on every device, and a
:exc:`ValueCheckError` for the callers that catch the host failure as a value check.

See Also:
    - :exc:`ValueCheckError`: the parent class, for value checks that always run on the host.
    - :func:`~kornia.core.check.disable_checks`: skips these checks too, except those that keep an index in bounds.
r   Nr   r   r   r   r   r       s   † õ
r   c                  ó>   a € ] tR t^®tRtRRRR/R V 3R llltRtV ;t# )r   a  Catch a device mismatch between tensors; also a ValueError.

:func:`~kornia.core.check.KORNIA_CHECK_SAME_DEVICE` and :func:`~kornia.core.check.KORNIA_CHECK_SAME_DEVICES` raise
it, and so do functions that check devices themselves.

Attributes:
    actual_devices: the devices of the tensors that failed validation.
    expected_device: the expected device.

See Also:
    - :exc:`TypeCheckError`: what :func:`~kornia.core.check.KORNIA_CHECK_SAME_DEVICES` raises for an argument that
      is not a non-empty list of tensors.
Úactual_devicesNÚexpected_devicec               ó$   € V ^8„  d   QhRRRRRR/# )r   r   r   r@   zOptional[list]rA   r:   r   )r   s   "r   r    ÚDeviceError.__annotate__½   s(   € ÷ 	/ñ 	/àð	/ð 'ð		/ð
 'ñ	/r   c               	ó>   <€ \         SV `  V4       W n        W0n        R # r#   )r$   r%   r@   rA   )r&   r   r@   rA   r'   s   &&$$€r   r%   ÚDeviceError.__init__½   s   ø€ ô 	‰Ñ˜Ô!Ø,ÔØ.Ör   )r@   rA   r*   r,   s   @r   r   r   ®   s+   ø† ñð	/ð *.ð		/ð
 *.÷	/÷ 	/ð 	/r   c                  ó   € ] tR t^ÉtRtRtR# )r   aN  Catch a tensor without the channel layout of an image; also a ValueError.

:func:`~kornia.core.check.KORNIA_CHECK_IS_COLOR`, :func:`~kornia.core.check.KORNIA_CHECK_IS_GRAY`,
:func:`~kornia.core.check.KORNIA_CHECK_IS_COLOR_OR_GRAY` and :func:`~kornia.core.check.KORNIA_CHECK_IS_IMAGE` raise
it when the shape does not match the channel layout they check. It carries no attributes.

See Also:
    - :exc:`ShapeError`: every other shape failure, with the shapes as attributes.
    - :exc:`ValueCheckError`: what :func:`~kornia.core.check.KORNIA_CHECK_IS_IMAGE` raises for values out of range.
r   Nr   r   r   r   r   r   É   r.   r   )r   r   r   r   r	   r
   r   r   )r   Ú
__future__r   Útypingr   r   ÚtorchÚ__all__Ú	Exceptionr   Ú
ValueErrorr
   ÚRuntimeErrorÚAssertionErrorr	   Ú	TypeErrorr   r   r   r   r   r   r   r   Ú<module>rP      sŒ   ðñ$õ$ #ç  ã ò	€ô�	ô ô-�˜Jô -ô:
�Z ¨~ô 
ô+�Y 	ô +ô8-�i ô -ô8�o |ô ô/�)˜Zô /ô6
�˜Jö 
r   