§
    ’©ºjÆ  ã                   ó†   — d dl mZ d dlmZ 	 ddedee         dee         deeeef         fd„Zdd	ed
ee         defd„ZdS )é    )ÚOptional)ÚTensorNÚxÚyÚzero_diagonalÚreturnc                 ó  — | j         dk    rt          d| j        › �¦  «        ‚|�=|j         dk    s|j        d         | j        d         k    rt          d¦  «        ‚|€dn|}n|                      ¦   «         }|€dn|}| ||fS )a6  Check that input has the right dimensionality and sets the ``zero_diagonal`` argument if user has not set it.

    Args:
        x: tensor of shape ``[N,d]``
        y: if provided, a tensor of shape ``[M,d]``
        zero_diagonal: determines if the diagonal of the distance matrix should be set to zero

    é   zBExpected argument `x` to be a 2D tensor of shape `[N, d]` but got Né   zoExpected argument `y` to be a 2D tensor of shape `[M, d]` where `d` should be same as the last dimension of `x`FT)ÚndimÚ
ValueErrorÚshapeÚclone)r   r   r   s      úx/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/torchmetrics/functional/pairwise/helpers.pyÚ_check_inputr      s¢   € ð 	„v�‚{€{ÝÐgÐ^_Ô^eÐgÐgÑhÔhÐhà€}ØŒ6�QŠ;ˆ;˜!œ' !œ*¨¬°¬
Ò2Ð2ÝðCñô ð ð "/Ð!6˜˜¸Mˆˆà�GŠG‰IŒIˆØ -Ð 5˜˜¸=ˆØˆa�ÐÐó    ÚdistmatÚ	reductionc                 óª   — |dk    r|                       d¬¦  «        S |dk    r|                      d¬¦  «        S |�|dk    r| S t          d|› �¦  «        ‚)z›Reduction of distance matrix.

    Args:
        distmat: a ``[N,M]`` matrix
        reduction: string determining how to reduce along last dimension

    Úmeanéÿÿÿÿ)ÚdimÚsumNÚnonez@Expected reduction to be one of `['mean', 'sum', None]` but got )r   r   r   )r   r   s     r   Ú_reduce_distance_matrixr   .   so   € ð �FÒÐØ�|Š| ˆ|Ñ#Ô#Ð#Ø�EÒÐØ�{Š{˜rˆ{Ñ"Ô"Ð"ØÐ˜I¨Ò/Ð/ØˆÝ
ÐcÐXaÐcÐcÑ
dÔ
dÐdr   )NN)N)	Útypingr   Útorchr   ÚboolÚtupler   Ústrr   © r   r   ú<module>r"      sÇ   ðð Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð ð LPðð ØðØ˜6Ô"ðØ:BÀ4¼.ðà
ˆ6�6˜4ÐÔ ðð ð ð ð6eð e Vð e¸À¼ð eÐQWð eð eð eð eð eð er   