ó
    Eñis	  ã                   ó’   • S SK r S SKJs  Jr  SSKJr     SS\ R                  S\ R                  S\S\S\	S	\ R                  4S
 jjr
g)é    Né   )Ú_log_api_usage_onceÚinputsÚtargetsÚalphaÚgammaÚ	reductionÚreturnc                 óD  • SUs=::  a  S::  d  O  US:w  a  [        SU S35      e[        R                  R                  5       (       d2  [        R                  R	                  5       (       d  [        [        5        [        R                  " U 5      n[        R                  " XSS9nXQ-  SU-
  SU-
  -  -   nUSU-
  U-  -  nUS:¼  a  X!-  SU-
  SU-
  -  -   n	X˜-  nUS:X  a   U$ US:X  a  UR                  5       nU$ US	:X  a  UR                  5       nU$ [        S
U S35      e)aÖ  
Loss used in RetinaNet for dense detection: https://arxiv.org/abs/1708.02002.

Args:
    inputs (Tensor): A float tensor of arbitrary shape.
            The predictions for each example.
    targets (Tensor): A float tensor with the same shape as inputs. Stores the binary
            classification label for each element in inputs
            (0 for the negative class and 1 for the positive class).
    alpha (float): Weighting factor in range [0, 1] to balance
            positive vs negative examples or -1 for ignore. Default: ``0.25``.
    gamma (float): Exponent of the modulating factor (1 - p_t) to
            balance easy vs hard examples. Default: ``2``.
    reduction (string): ``'none'`` | ``'mean'`` | ``'sum'``
            ``'none'``: No reduction will be applied to the output.
            ``'mean'``: The output will be averaged.
            ``'sum'``: The output will be summed. Default: ``'none'``.
Returns:
    Loss tensor with the reduction option applied.
r   é   éÿÿÿÿzInvalid alpha value: z4. alpha must be in the range [0,1] or -1 for ignore.Únone)r	   ÚmeanÚsumz$Invalid Value for arg 'reduction': 'z3 
 Supported reduction modes: 'none', 'mean', 'sum')Ú
ValueErrorÚtorchÚjitÚis_scriptingÚ
is_tracingr   Úsigmoid_focal_lossÚsigmoidÚFÚ binary_cross_entropy_with_logitsr   r   )
r   r   r   r   r	   ÚpÚce_lossÚp_tÚlossÚalpha_ts
             ÚW/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torchvision/ops/focal_loss.pyr   r      s4  € ð: ��O˜!�O ¨"£ÜÐ0°°Ð7kÐlÓmÐmä�9‰9×!Ñ!×#Ñ#¬E¯I©I×,@Ñ,@×,BÑ,BÜÔ.Ô/Ü�Š�fÓ€AÜ×0Ò0°ÈFÑS€GØ
‰+˜˜Q™ 1 w¡;Ñ/Ñ
/€CØ�q˜3‘w 5Ñ(Ñ)€Dà�ƒzØ‘/ Q¨¡Y°1°w±;Ñ$?Ñ?ˆØ‰~ˆð �FÓØð €Kð 
�fÓ	Ø�y‰y‹{ˆð €Kð 
�eÓ	Ø�x‰x‹zˆð
 €Kô Ø2°9°+Ð=qÐró
ð 	
ó    )g      Ð?r   r   )r   Útorch.nn.functionalÚnnÚ
functionalr   Úutilsr   ÚTensorÚfloatÚstrr   © r    r   Ú<module>r)      se   ðÛ ß Ð å 'ð ØØñ6Ø�L‰Lð6à�\‰\ð6ð ð6ð ð	6ð
 ð6ð ‡\�\ö6r    