+
    åûj	  ã                  ó2   € ^ RI Ht ^ RIHt ^ RItR R ltR# )é    )Úannotations)ÚOptionalNc               ó$   € V ^8„  d   QhRRRRRR/# )é   Útargetztorch.TensorÚignore_indexzOptional[int]Úreturnz+tuple[torch.Tensor, Optional[torch.Tensor]]© )Úformats   "ÚPC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\kornia\losses\_utils.pyÚ__annotate__r      s$   € ÷ "ñ "Øð"Ø(5ð"à0ñ"ó    c                ó`   € Vf   V R3# W8g  pV P                  W P                  ^4      4      p W3# )aU  Replace ignored target labels with a valid class and return their mask.

Loss functions often need class indices to stay inside the valid class
range before one-hot encoding or gathering. This helper keeps valid labels
unchanged, maps ignored positions to class ``0`` temporarily, and returns a
mask so callers can remove those positions from the final loss.

Args:
    target: Target label tensor with arbitrary shape.
    ignore_index: Label value that should be ignored. If ``None``, no
        masking is applied.

Returns:
    Tuple ``(target, target_mask)``. ``target`` is either the original
    tensor or a copy where ignored labels were replaced by zero.
    ``target_mask`` is ``None`` only when ``ignore_index`` is ``None``;
    otherwise it is a boolean tensor with ``True`` at valid positions
    (all-``True`` when no pixels are ignored).
N)ÚwhereÚ	new_zeros)r   r   Útarget_masks   && r   Úmask_ignore_pixelsr      s@   € ð, ÒØ�tˆ|ÐàÑ(€Kð �\‰\˜+×'7Ñ'7¸Ó':Ó;€FàÐÐr   )Ú
__future__r   Útypingr   Útorchr   r
   r   r   Ú<module>r      s   ðõ$ #å ã ÷"r   