§
    ’©ºjnU  ã                   ó  — d dl mZmZmZ d dlZd dlmZ d dlmZ d dlm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZ d dlmZ dedefd	„Zd
ededededeeef         f
d„Z	 	 d&dedeeeee         ef                  dee         ddfd„Z defdeeeeef         f         dee         dedededeeef         fd„Z!	 	 	 d'dedededeeeee         ef                  dee         de"deeef         fd„Z#	 	 d&dededeeeee         ef                  dee         ddf
d„Z$efdeeeeef         f         dedee         dededeeef         fd„Z%	 	 	 d'dededededeeeee         ef                  dee         de"deeef         fd„Z&	 	 d&dededeeeee         ef                  dee         ddf
d „Z'efdeeeeef         f         dedee         dee         dededeeef         fd!„Z(	 	 	 d'dededededeeeee         ef                  dee         de"deeef         fd"„Z)	 	 	 	 	 d(deded#ed$         dedeeeee         ef                  dee         dee         dee         de"deeeef                  fd%„Z*dS ))é    )ÚCallableÚOptionalÚUnionN)ÚTensor)ÚLiteral)Ú-_binary_precision_recall_curve_arg_validationÚ&_binary_precision_recall_curve_computeÚ%_binary_precision_recall_curve_formatÚ0_binary_precision_recall_curve_tensor_validationÚ%_binary_precision_recall_curve_updateÚ1_multiclass_precision_recall_curve_arg_validationÚ*_multiclass_precision_recall_curve_computeÚ)_multiclass_precision_recall_curve_formatÚ4_multiclass_precision_recall_curve_tensor_validationÚ)_multiclass_precision_recall_curve_updateÚ1_multilabel_precision_recall_curve_arg_validationÚ*_multilabel_precision_recall_curve_computeÚ)_multilabel_precision_recall_curve_formatÚ4_multilabel_precision_recall_curve_tensor_validationÚ)_multilabel_precision_recall_curve_update)ÚClassificationTaskÚxÚreturnc                 ó8  — d}t          | j        d         ¦  «        D ]k}|�
| ||f         n| dd…|f         }t          j        ||                     ¦   «         k    ¦  «        d         }|€|n||         }t          |¦  «        dk     r nŒl|€t          d¦  «        ‚|S )z˜Returns the index of the maximum value in a list of tuples according to lexicographic ordering.

    Based on https://stackoverflow.com/a/65615160

    Né   r   é   zFailed to extract index)ÚrangeÚshapeÚtorchÚwhereÚmaxÚlenÚ
ValueError)r   ÚidxÚkÚcolÚzs        ú�/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/torchmetrics/functional/classification/recall_fixed_precision.pyÚ
_lexargmaxr)   (   s«   € ð !€CÝ�1”7˜1”:ÑÔð ð ˆØ#& ?�a˜˜Q˜”i�i¸¸!¸!¸!¸Q¸$¼ˆÝŒK˜˜sŸwšw™yœyÒ(Ñ)Ô)¨!Ô,ˆØ�;ˆaˆa C¨¤FˆÝˆs‰8Œ8�aŠ<ˆ<ØˆEð à
€{ÝÐ2Ñ3Ô3Ð3Ø€Jó    Ú	precisionÚrecallÚ
thresholdsÚmin_precisionc                 ó  — t          j        d|j        |j        ¬¦  «        }t          j        d¦  «        }t	          d„ || |fD ¦   «         ¦  «        }t          j        |d |…         | d |…         |d |…         f¦  «        j        }||d d …df         |k             }|j        d         dk    r!t          |¦  «        d         }	||	         \  }}
}|dk    r.t          j        t          d¦  «        |j        |j        ¬¦  «        }||fS )Ng        )ÚdeviceÚdtyper   c              3   ó0   K  — | ]}|j         d          V — ŒdS )r   N)r   )Ú.0Úts     r(   ú	<genexpr>z'_recall_at_precision.<locals>.<genexpr>C   s(   è è € ÐIÐI A�Q”W˜Q”ZÐIÐIÐIÐIÐIÐIr*   r   Únan)
r   Útensorr0   r1   ÚminÚvstackÚTr   r)   Úfloat)r+   r,   r-   r.   Ú
max_recallÚbest_thresholdÚ
zipped_lenÚzippedÚzipped_maskedr$   Ú_s              r(   Ú_recall_at_precisionrB   :   s  € õ ”˜c¨&¬-¸v¼|ÐLÑLÔL€JÝ”\ !‘_”_€NåÐIÐI¨&°)¸ZÐ)HÐIÑIÔIÑIÔI€JÝŒ\˜6 + : +Ô.°	¸+¸:¸+Ô0FÈ
ÐS^ÐT^ÐS^ÔH_Ð`ÑaÔaÔc€FØ˜6 ! ! ! Q $œ<¨=Ò8Ô9€MØÔ˜1Ô Ò!Ð!Ý˜Ñ'Ô'¨Ô*ˆØ(5°cÔ(:Ñ%ˆ
�A�~Ø�SÒÐÝœ¥e¨E¡l¤l¸:Ô;LÐT^ÔTdÐeÑeÔeˆà�~Ð%Ð%r*   Úignore_indexc                 ó–   — t          ||¦  «         t          | t          ¦  «        s!d| cxk    rdk    sn t          d| › �¦  «        ‚d S d S ©Nr   r   zMExpected argument `min_precision` to be an float in the [0,1] range, but got )r   Ú
isinstancer;   r#   )r.   r-   rC   s      r(   Ú0_binary_recall_at_fixed_precision_arg_validationrG   O   sr   € õ
 2°*¸lÑKÔKÐKÝ�m¥UÑ+Ô+ð 
°Q¸-Ð5LÐ5LÒ5LÐ5LÈ1Ò5LÐ5LÐ5LÐ5LÝØkÐ\iÐkÐkñ
ô 
ð 	
ð
ð 
Ð5LÐ5Lr*   r   ÚstateÚ	pos_labelÚ	reduce_fnc                 óH   — t          | ||¦  «        \  }}} |||||¦  «        S )N)r	   )rH   r-   r.   rI   rJ   r+   r,   s          r(   Ú)_binary_recall_at_fixed_precision_computerL   [   s5   € õ %KÈ5ÐR\Ð^gÑ$hÔ$hÑ!€Iˆv�zØˆ9�Y ¨
°MÑBÔBÐBr*   TÚpredsÚtargetÚvalidate_argsc                 óº   — |r"t          |||¦  «         t          | ||¦  «         t          | |||¦  «        \  } }}t          | ||¦  «        }t	          |||¦  «        S )a›  Compute the highest possible recall value given the minimum precision thresholds provided for binary tasks.

    This is done by first calculating the precision-recall curve for different thresholds and the find the recall
    for a given precision level.

    Accepts the following input tensors:

    - ``preds`` (float tensor): ``(N, ...)``. Preds should be a tensor containing probabilities or logits for each
      observation. If preds has values outside [0,1] range we consider the input to be logits and will auto apply
      sigmoid per element.
    - ``target`` (int tensor): ``(N, ...)``. Target should be a tensor containing ground truth labels, and therefore
      only contain {0,1} values (except if `ignore_index` is specified). The value 1 always encodes the positive class.

    Additional dimension ``...`` will be flattened into the batch dimension.

    The implementation both supports calculating the metric in a non-binned but accurate version and a binned version
    that is less accurate but more memory efficient. Setting the `thresholds` argument to ``None`` will activate the
    non-binned  version that uses memory of size :math:`\mathcal{O}(n_{samples})` whereas setting the `thresholds`
    argument to either an integer, list or a 1d tensor will use a binned version that uses memory of
    size :math:`\mathcal{O}(n_{thresholds})` (constant memory).

    Args:
        preds: Tensor with predictions
        target: Tensor with true labels
        min_precision: float value specifying minimum precision threshold.
        thresholds:
            Can be one of:

            - If set to ``None``, will use a non-binned approach where thresholds are dynamically calculated from
              all the data. Most accurate but also most memory consuming approach.
            - If set to an ``int`` (larger than 1), will use that number of thresholds linearly spaced from
              0 to 1 as bins for the calculation.
            - If set to an ``list`` of floats, will use the indicated thresholds in the list as bins for the calculation
            - If set to an 1d :class:`~torch.Tensor` of floats, will use the indicated thresholds in the tensor as
              bins for the calculation.

        ignore_index:
            Specifies a target value that is ignored and does not contribute to the metric calculation
        validate_args: bool indicating if input arguments and tensors should be validated for correctness.
            Set to ``False`` for faster computations.

    Returns:
        (tuple): a tuple of 2 tensors containing:

        - recall: an scalar tensor with the maximum recall for the given precision level
        - threshold: an scalar tensor with the corresponding threshold level

    Example:
        >>> from torchmetrics.functional.classification import binary_recall_at_fixed_precision
        >>> preds = torch.tensor([0, 0.5, 0.7, 0.8])
        >>> target = torch.tensor([0, 1, 1, 0])
        >>> binary_recall_at_fixed_precision(preds, target, min_precision=0.5, thresholds=None)
        (tensor(1.), tensor(0.5000))
        >>> binary_recall_at_fixed_precision(preds, target, min_precision=0.5, thresholds=5)
        (tensor(1.), tensor(0.5000))

    )rG   r   r
   r   rL   )rM   rN   r.   r-   rC   rO   rH   s          r(   Ú binary_recall_at_fixed_precisionrQ   f   sr   € ðB ð VÝ8¸È
ÐT`ÑaÔaÐaÝ8¸ÀÈÑUÔUÐUÝ EÀeÈVÐU_ÐamÑ nÔ nÑ€Eˆ6�:Ý1°%¸ÀÑLÔL€EÝ4°U¸JÈÑVÔVÐVr*   Únum_classesc                 ó˜   — t          | ||¦  «         t          |t          ¦  «        s!d|cxk    rdk    sn t          d|› �¦  «        ‚d S d S rE   )r   rF   r;   r#   )rR   r.   r-   rC   s       r(   Ú4_multiclass_recall_at_fixed_precision_arg_validationrT   ¯   st   € õ 6°kÀ:È|Ñ\Ô\Ð\Ý�m¥UÑ+Ô+ð 
°Q¸-Ð5LÐ5LÒ5LÐ5LÈ1Ò5LÐ5LÐ5LÐ5LÝØkÐ\iÐkÐkñ
ô 
ð 	
ð
ð 
Ð5LÐ5Lr*   c                 óV  ‡‡‡— t          | |‰¦  «        \  }}Št          | t          ¦  «        rˆˆˆfd„t          ||¦  «        D ¦   «         }nˆˆfd„t          ||‰¦  «        D ¦   «         }t	          j        d„ |D ¦   «         ¦  «        }t	          j        d„ |D ¦   «         ¦  «        Š|‰fS )Nc                 ó2   •— g | ]\  }} ‰||‰‰¦  «        ‘ŒS © rW   ©r3   ÚpÚrr.   rJ   r-   s      €€€r(   ú
<listcomp>zE_multiclass_recall_at_fixed_precision_arg_compute.<locals>.<listcomp>Å   ó-   ø€ Ð]Ð]Ð]¹d¸aÀˆyˆy˜˜A˜z¨=Ñ9Ô9Ð]Ð]Ð]r*   c                 ó4   •— g | ]\  }}} ‰|||‰¦  «        ‘ŒS rW   rW   ©r3   rY   rZ   r4   r.   rJ   s       €€r(   r[   zE_multiclass_recall_at_fixed_precision_arg_compute.<locals>.<listcomp>Ç   ó/   ø€ ÐcÐcÐc±W°Q¸¸1ˆyˆy˜˜A˜q -Ñ0Ô0ÐcÐcÐcr*   c                 ó   — g | ]
}|d          ‘ŒS ©r   rW   ©r3   rZ   s     r(   r[   zE_multiclass_recall_at_fixed_precision_arg_compute.<locals>.<listcomp>È   ó   € Ð,Ð,Ð, 1˜!˜Aœ$Ð,Ð,Ð,r*   c                 ó   — g | ]
}|d          ‘ŒS ©r   rW   rb   s     r(   r[   zE_multiclass_recall_at_fixed_precision_arg_compute.<locals>.<listcomp>É   ó   € Ð0Ð0Ð0 q˜a œdÐ0Ð0Ð0r*   )r   rF   r   Úzipr   Ústack)rH   rR   r-   r.   rJ   r+   r,   Úress     ```   r(   Ú1_multiclass_recall_at_fixed_precision_arg_computerj   ¼   sÑ   øøø€ õ %OÈuÐVaÐcmÑ$nÔ$nÑ!€Iˆv�zÝ�%�Ñ Ô ð dØ]Ð]Ð]Ð]Ð]Ð]ÅcÈ)ÐU[ÑF\ÔF\Ð]Ñ]Ô]ˆˆàcÐcÐcÐcÐcÅÀIÈvÐWaÑ@bÔ@bÐcÑcÔcˆÝŒ[Ð,Ð,¨Ð,Ñ,Ô,Ñ-Ô-€FÝ”Ð0Ð0¨CÐ0Ñ0Ô0Ñ1Ô1€JØ�:ÐÐr*   c                 óÄ   — |r$t          ||||¦  «         t          | |||¦  «         t          | ||||¦  «        \  } }}t          | |||¦  «        }t	          ||||¦  «        S )ay  Compute the highest possible recall value given the minimum precision thresholds provided for multiclass tasks.

    This is done by first calculating the precision-recall curve for different thresholds and the find the recall for a
    given precision level.

    Accepts the following input tensors:

    - ``preds`` (float tensor): ``(N, C, ...)``. Preds should be a tensor containing probabilities or logits for each
      observation. If preds has values outside [0,1] range we consider the input to be logits and will auto apply
      softmax per sample.
    - ``target`` (int tensor): ``(N, ...)``. Target should be a tensor containing ground truth labels, and therefore
      only contain values in the [0, n_classes-1] range (except if `ignore_index` is specified).

    Additional dimension ``...`` will be flattened into the batch dimension.

    The implementation both supports calculating the metric in a non-binned but accurate version and a binned version
    that is less accurate but more memory efficient. Setting the `thresholds` argument to ``None`` will activate the
    non-binned  version that uses memory of size :math:`\mathcal{O}(n_{samples})` whereas setting the `thresholds`
    argument to either an integer, list or a 1d tensor will use a binned version that uses memory of
    size :math:`\mathcal{O}(n_{thresholds} \times n_{classes})` (constant memory).

    Args:
        preds: Tensor with predictions
        target: Tensor with true labels
        num_classes: Integer specifying the number of classes
        min_precision: float value specifying minimum precision threshold.
        thresholds:
            Can be one of:

            - If set to ``None``, will use a non-binned approach where thresholds are dynamically calculated from
              all the data. Most accurate but also most memory consuming approach.
            - If set to an ``int`` (larger than 1), will use that number of thresholds linearly spaced from
              0 to 1 as bins for the calculation.
            - If set to an ``list`` of floats, will use the indicated thresholds in the list as bins for the calculation
            - If set to an 1d :class:`~torch.Tensor` of floats, will use the indicated thresholds in the tensor as
              bins for the calculation.

        ignore_index:
            Specifies a target value that is ignored and does not contribute to the metric calculation
        validate_args: bool indicating if input arguments and tensors should be validated for correctness.
            Set to ``False`` for faster computations.

    Returns:
        (tuple): a tuple of either 2 tensors or 2 lists containing

        - recall: an 1d tensor of size (n_classes, ) with the maximum recall for the given precision level per class
        - thresholds: an 1d tensor of size (n_classes, ) with the corresponding threshold level per class

    Example:
        >>> from torchmetrics.functional.classification import multiclass_recall_at_fixed_precision
        >>> preds = torch.tensor([[0.75, 0.05, 0.05, 0.05, 0.05],
        ...                       [0.05, 0.75, 0.05, 0.05, 0.05],
        ...                       [0.05, 0.05, 0.75, 0.05, 0.05],
        ...                       [0.05, 0.05, 0.05, 0.75, 0.05]])
        >>> target = torch.tensor([0, 1, 3, 2])
        >>> multiclass_recall_at_fixed_precision(preds, target, num_classes=5, min_precision=0.5, thresholds=None)
        (tensor([1., 1., 0., 0., 0.]), tensor([0.7500, 0.7500, nan, nan, nan]))
        >>> multiclass_recall_at_fixed_precision(preds, target, num_classes=5, min_precision=0.5, thresholds=5)
        (tensor([1., 1., 0., 0., 0.]), tensor([0.7500, 0.7500, nan, nan, nan]))

    )rT   r   r   r   rj   )rM   rN   rR   r.   r-   rC   rO   rH   s           r(   Ú$multiclass_recall_at_fixed_precisionrl   Í   s†   € ðL ð gÝ<¸[È-ÐYcÐeqÑrÔrÐrÝ<¸UÀFÈKÐYeÑfÔfÐfÝ IØˆv�{ J°ñ!ô !Ñ€Eˆ6�:õ 6°e¸VÀ[ÐR\Ñ]Ô]€EÝ<¸UÀKÐQ[Ð]jÑkÔkÐkr*   Ú
num_labelsc                 ó˜   — t          | ||¦  «         t          |t          ¦  «        s!d|cxk    rdk    sn t          d|› �¦  «        ‚d S d S rE   )r   rF   r;   r#   )rm   r.   r-   rC   s       r(   Ú4_multilabel_recall_at_fixed_precision_arg_validationro     st   € õ 6°jÀ*ÈlÑ[Ô[Ð[Ý�m¥UÑ+Ô+ð 
°Q¸-Ð5LÐ5LÒ5LÐ5LÈ1Ò5LÐ5LÐ5LÐ5LÝØkÐ\iÐkÐkñ
ô 
ð 	
ð
ð 
Ð5LÐ5Lr*   c                 óX  ‡‡‡— t          | |‰|¦  «        \  }}Št          | t          ¦  «        rˆˆˆfd„t          ||¦  «        D ¦   «         }nˆˆfd„t          ||‰¦  «        D ¦   «         }t	          j        d„ |D ¦   «         ¦  «        }t	          j        d„ |D ¦   «         ¦  «        Š|‰fS )Nc                 ó2   •— g | ]\  }} ‰||‰‰¦  «        ‘ŒS rW   rW   rX   s      €€€r(   r[   zE_multilabel_recall_at_fixed_precision_arg_compute.<locals>.<listcomp>6  r\   r*   c                 ó4   •— g | ]\  }}} ‰|||‰¦  «        ‘ŒS rW   rW   r^   s       €€r(   r[   zE_multilabel_recall_at_fixed_precision_arg_compute.<locals>.<listcomp>8  r_   r*   c                 ó   — g | ]
}|d          ‘ŒS ra   rW   rb   s     r(   r[   zE_multilabel_recall_at_fixed_precision_arg_compute.<locals>.<listcomp>9  rc   r*   c                 ó   — g | ]
}|d          ‘ŒS re   rW   rb   s     r(   r[   zE_multilabel_recall_at_fixed_precision_arg_compute.<locals>.<listcomp>:  rf   r*   )r   rF   r   rg   r   rh   )	rH   rm   r-   rC   r.   rJ   r+   r,   ri   s	     ` ``   r(   Ú1_multilabel_recall_at_fixed_precision_arg_computeru   *  sØ   øøø€ õ %OØˆz˜: |ñ%ô %Ñ!€Iˆv�zõ �%�Ñ Ô ð dØ]Ð]Ð]Ð]Ð]Ð]ÅcÈ)ÐU[ÑF\ÔF\Ð]Ñ]Ô]ˆˆàcÐcÐcÐcÐcÅÀIÈvÐWaÑ@bÔ@bÐcÑcÔcˆÝŒ[Ð,Ð,¨Ð,Ñ,Ô,Ñ-Ô-€FÝ”Ð0Ð0¨CÐ0Ñ0Ô0Ñ1Ô1€JØ�:ÐÐr*   c                 óÆ   — |r$t          ||||¦  «         t          | |||¦  «         t          | ||||¦  «        \  } }}t          | |||¦  «        }t	          |||||¦  «        S )a›  Compute the highest possible recall value given the minimum precision thresholds provided for multilabel tasks.

    This is done by first calculating the precision-recall curve for different thresholds and the find the recall for a
    given precision level.

    Accepts the following input tensors:

    - ``preds`` (float tensor): ``(N, C, ...)``. Preds should be a tensor containing probabilities or logits for each
      observation. If preds has values outside [0,1] range we consider the input to be logits and will auto apply
      sigmoid per element.
    - ``target`` (int tensor): ``(N, C, ...)``. Target should be a tensor containing ground truth labels, and therefore
      only contain {0,1} values (except if `ignore_index` is specified).

    Additional dimension ``...`` will be flattened into the batch dimension.

    The implementation both supports calculating the metric in a non-binned but accurate version and a binned version
    that is less accurate but more memory efficient. Setting the `thresholds` argument to ``None`` will activate the
    non-binned  version that uses memory of size :math:`\mathcal{O}(n_{samples})` whereas setting the `thresholds`
    argument to either an integer, list or a 1d tensor will use a binned version that uses memory of
    size :math:`\mathcal{O}(n_{thresholds} \times n_{labels})` (constant memory).

    Args:
        preds: Tensor with predictions
        target: Tensor with true labels
        num_labels: Integer specifying the number of labels
        min_precision: float value specifying minimum precision threshold.
        thresholds:
            Can be one of:

            - If set to ``None``, will use a non-binned approach where thresholds are dynamically calculated from
              all the data. Most accurate but also most memory consuming approach.
            - If set to an ``int`` (larger than 1), will use that number of thresholds linearly spaced from
              0 to 1 as bins for the calculation.
            - If set to an ``list`` of floats, will use the indicated thresholds in the list as bins for the calculation
            - If set to an 1d :class:`~torch.Tensor` of floats, will use the indicated thresholds in the tensor as
              bins for the calculation.

        ignore_index:
            Specifies a target value that is ignored and does not contribute to the metric calculation
        validate_args: bool indicating if input arguments and tensors should be validated for correctness.
            Set to ``False`` for faster computations.

    Returns:
        (tuple): a tuple of either 2 tensors or 2 lists containing

        - recall: an 1d tensor of size (n_classes, ) with the maximum recall for the given precision level per class
        - thresholds: an 1d tensor of size (n_classes, ) with the corresponding threshold level per class

    Example:
        >>> from torchmetrics.functional.classification import multilabel_recall_at_fixed_precision
        >>> preds = torch.tensor([[0.75, 0.05, 0.35],
        ...                       [0.45, 0.75, 0.05],
        ...                       [0.05, 0.55, 0.75],
        ...                       [0.05, 0.65, 0.05]])
        >>> target = torch.tensor([[1, 0, 1],
        ...                        [0, 0, 0],
        ...                        [0, 1, 1],
        ...                        [1, 1, 1]])
        >>> multilabel_recall_at_fixed_precision(preds, target, num_labels=3, min_precision=0.5, thresholds=None)
        (tensor([1., 1., 1.]), tensor([0.0500, 0.5500, 0.0500]))
        >>> multilabel_recall_at_fixed_precision(preds, target, num_labels=3, min_precision=0.5, thresholds=5)
        (tensor([1., 1., 1.]), tensor([0.0000, 0.5000, 0.0000]))

    )ro   r   r   r   ru   )rM   rN   rm   r.   r-   rC   rO   rH   s           r(   Ú$multilabel_recall_at_fixed_precisionrw   >  s‰   € ðR ð fÝ<¸ZÈÐXbÐdpÑqÔqÐqÝ<¸UÀFÈJÐXdÑeÔeÐeÝ IØˆv�z :¨|ñ!ô !Ñ€Eˆ6�:õ 6°e¸VÀZÐQ[Ñ\Ô\€EÝ<¸UÀJÐPZÐ\hÐjwÑxÔxÐxr*   Útask)ÚbinaryÚ
multiclassÚ
multilabelc	           	      óÞ  — t          j        |¦  «        }|t           j        k    rt          | |||||¦  «        S |t           j        k    rJt          |t          ¦  «        s t          dt          |¦  «        › d�¦  «        ‚t          | ||||||¦  «        S |t           j
        k    rJt          |t          ¦  «        s t          dt          |¦  «        › d�¦  «        ‚t          | ||||||¦  «        S dS )a)  Compute the highest possible recall value given the minimum precision thresholds provided.

    This is done by first calculating the precision-recall curve for different thresholds and the find the recall for a
    given precision level.

    This function is a simple wrapper to get the task specific versions of this metric, which is done by setting the
    ``task`` argument to either ``'binary'``, ``'multiclass'`` or ``'multilabel'``. See the documentation of
    :func:`~torchmetrics.functional.classification.binary_recall_at_fixed_precision`,
    :func:`~torchmetrics.functional.classification.multiclass_recall_at_fixed_precision` and
    :func:`~torchmetrics.functional.classification.multilabel_recall_at_fixed_precision` for the specific details of
    each argument influence and examples.

    z+`num_classes` is expected to be `int` but `z was passed.`z*`num_labels` is expected to be `int` but `N)r   Úfrom_strÚBINARYrQ   Ú
MULTICLASSrF   Úintr#   Útyperl   Ú
MULTILABELrw   )	rM   rN   rx   r.   r-   rR   rm   rC   rO   s	            r(   Úrecall_at_fixed_precisionrƒ   ‘  s  € õ0 Ô& tÑ,Ô,€DØÕ!Ô(Ò(Ð(Ý/°°v¸}ÈjÐZfÐhuÑvÔvÐvØÕ!Ô,Ò,Ð,Ý˜+¥sÑ+Ô+ð 	mÝÐkÍ4ÐP[ÑK\ÔK\ÐkÐkÐkÑlÔlÐlÝ3Ø�6˜;¨°zÀ<ÐQ^ñ
ô 
ð 	
ð Õ!Ô,Ò,Ð,Ý˜*¥cÑ*Ô*ð 	kÝÐiÍ$ÈzÑJZÔJZÐiÐiÐiÑjÔjÐjÝ3Ø�6˜: }°jÀ,ÐP]ñ
ô 
ð 	
ð ˆ4r*   )NN)NNT)NNNNT)+Útypingr   r   r   r   r   Útyping_extensionsr   Ú=torchmetrics.functional.classification.precision_recall_curver   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   Útorchmetrics.utilities.enumsr   r)   r;   ÚtuplerB   r€   ÚlistrG   rL   ÚboolrQ   rT   rj   rl   ro   ru   rw   rƒ   rW   r*   r(   ú<module>r‹      s÷  ðð -Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,à €€€Ø Ð Ð Ð Ð Ð Ø %Ð %Ð %Ð %Ð %Ð %ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð" <Ð ;Ð ;Ð ;Ð ;Ð ;ð�&ð ˜Vð ð ð ð ð$&Øð&àð&ð ð&ð ð	&ð
 ˆ6�6ˆ>Ôð&ð &ð &ð &ð. =AØ"&ð	
ð 	
Øð	
à˜˜s D¨¤K°Ð7Ô8Ô9ð	
ð ˜3”-ð	
ð 
ð		
ð 	
ð 	
ð 	
ð  Ø.ðCð CØ�˜˜v v˜~Ô.Ð.Ô/ðCà˜Ô ðCð ðCð ð	Cð
 ðCð ˆ6�6ˆ>ÔðCð Cð Cð Cð =AØ"&ØðFWð FWØðFWàðFWð ðFWð ˜˜s D¨¤K°Ð7Ô8Ô9ð	FWð
 ˜3”-ðFWð ðFWð ˆ6�6ˆ>ÔðFWð FWð FWð FWðX =AØ"&ð	

ð 

Øð

àð

ð ˜˜s D¨¤K°Ð7Ô8Ô9ð

ð ˜3”-ð	

ð
 
ð

ð 

ð 

ð 

ð$ /ðð Ø�˜˜v v˜~Ô.Ð.Ô/ðàðð ˜Ô ðð ð	ð
 ðð ˆ6�6ˆ>Ôðð ð ð ð, =AØ"&ØðMlð MlØðMlàðMlð ðMlð ð	Mlð
 ˜˜s D¨¤K°Ð7Ô8Ô9ðMlð ˜3”-ðMlð ðMlð ˆ6�6ˆ>ÔðMlð Mlð Mlð Mlðf =AØ"&ð	

ð 

Øð

àð

ð ˜˜s D¨¤K°Ð7Ô8Ô9ð

ð ˜3”-ð	

ð
 
ð

ð 

ð 

ð 

ð& /ðð Ø�˜˜v v˜~Ô.Ð.Ô/ðàðð ˜Ô ðð ˜3”-ð	ð
 ðð ðð ˆ6�6ˆ>Ôðð ð ð ð2 =AØ"&ØðPyð PyØðPyàðPyð ðPyð ð	Pyð
 ˜˜s D¨¤K°Ð7Ô8Ô9ðPyð ˜3”-ðPyð ðPyð ˆ6�6ˆ>ÔðPyð Pyð Pyð Pyðp =AØ!%Ø $Ø"&Øð'ð 'Øð'àð'ð Ð6Ô
7ð'ð ð	'ð
 ˜˜s D¨¤K°Ð7Ô8Ô9ð'ð ˜#”ð'ð ˜”ð'ð ˜3”-ð'ð ð'ð ˆe�F˜F�NÔ#Ô$ð'ð 'ð 'ð 'ð 'ð 'r*   