Ë
    èÓ^j§  ã                  óN   — d dl mZ d dlmZ d dlZd dlZddlmZ  G d„ de«      Z	y)é    )Úannotations)ÚAnyNé   )ÚTVTensorc                  ó4   — e Zd ZdZddddœ	 	 	 	 	 	 	 	 	 dd„Zy)ÚMaska  :class:`torch.Tensor` subclass for segmentation and detection masks with shape ``[..., H, W]``.

    Args:
        data (tensor-like, PIL.Image.Image): Any data that can be turned into a tensor with :func:`torch.as_tensor` as
            well as PIL images.
        dtype (torch.dtype, optional): Desired data type. If omitted, will be inferred from
            ``data``.
        device (torch.device, optional): Desired device. If omitted and ``data`` is a
            :class:`torch.Tensor`, the device is taken from it. Otherwise, the mask is constructed on the CPU.
        requires_grad (bool, optional): Whether autograd should record operations. If omitted and
            ``data`` is a :class:`torch.Tensor`, the value is taken from it. Otherwise, defaults to ``False``.
    N©ÚdtypeÚdeviceÚrequires_gradc               óÄ   — t        |t        j                  j                  «      rddlm} |j                  |«      }| j                  ||||¬«      }|j                  | «      S )Nr   )Ú
functionalr	   )Ú
isinstanceÚPILÚImageÚtorchvision.transforms.v2r   Úpil_to_tensorÚ
_to_tensorÚas_subclass)ÚclsÚdatar
   r   r   ÚFÚtensors          úg/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/torchvision/tv_tensors/_mask.pyÚ__new__zMask.__new__   sO   € ô �dœCŸI™IŸO™OÔ,ÝAà—?‘? 4Ó(ˆDà—‘ ¨E¸&ÐP]�Ó^ˆØ×!Ñ! #Ó&Ð&ó    )
r   r   r
   ztorch.dtype | Noner   ztorch.device | str | int | Noner   zbool | NoneÚreturnr   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   © r   r   r   r      sG   „ ñð" %)Ø26Ø%)ñ'àð'ð "ð	'ð
 0ð'ð #ð'ð 
ô'r   r   )
Ú
__future__r   Útypingr   Ú	PIL.Imager   ÚtorchÚ
_tv_tensorr   r   r"   r   r   ú<module>r(      s    ðÝ "å ã Û å  ô'ˆ8õ 'r   