Ë
    þÍ:jÆ  ã                   ól   — 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y)é    )ÚOptional)ÚTensorNÚxÚyÚzero_diagonalÚreturnc                 ó
  — | j                   dk7  rt        d| j                  › �«      ‚|�@|j                   dk7  s|j                  d   | j                  d   k7  rt        d«      ‚|€dn|}n| j                  «       }|€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 é   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      ú}/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/torchmetrics/functional/pairwise/helpers.pyÚ_check_inputr      s–   € ð 	‡v�v�‚{ÜÐ]Ð^_×^eÑ^eÐ]fÐgÓhÐhà€}Ø�6‰6�QŠ;˜!Ÿ'™' !™*¨¯©°©
Ò2ÜðCóð ð "/Ð!6™¸M‰à�G‰G‹IˆØ -Ð 5™¸=ˆØˆa�ÐÐó    ÚdistmatÚ	reductionc                 óŒ   — |dk(  r| j                  d¬«      S |dk(  r| j                  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ÚsumÚnonez@Expected reduction to be one of `['mean', 'sum', None]` but got )r   r   r   )r   r   s     r   Ú_reduce_distance_matrixr   .   s]   € ð �FÒØ�|‰| ˆ|Ó#Ð#Ø�EÒØ�{‰{˜rˆ{Ó"Ð"ØÐ˜I¨Ò/ØˆÜ
ÐWÐXaÐWbÐcÓ
dÐdr   )NN)N)	Útypingr   Útorchr   ÚboolÚtupler   Ústrr   © r   r   ú<module>r"      sq   ðõ å ð LPñØðØ˜6Ñ"ðØ:BÀ4¹.ðà
ˆ6�6˜4ÐÑ óñ6e Vð e¸À¹ð eÐQWô er   