§
    %`ƒi”  ã                   ój   — d dl Z d dlmZmZ d dlZd dlZd dlZd dl	m
Z d dlmZ  G d„ de¦  «        ZdS )é    N)ÚAnyÚUnion)Ú
functional)Ú	Transformc                   ó¦   ‡ — e Zd ZdZej        j        ej        fZdˆ fd„Z	de
ej        j        ej        f         deeef         dej        fd„Zˆ xZS )	ÚToTensora‚  [DEPRECATED] Use ``v2.Compose([v2.ToImage(), v2.ToDtype(torch.float32, scale=True)])`` instead.

    Convert a PIL Image or ndarray to tensor and scale the values accordingly.

    .. warning::
        :class:`v2.ToTensor` is deprecated and will be removed in a future release.
        Please use instead ``v2.Compose([v2.ToImage(), v2.ToDtype(torch.float32, scale=True)])``.
        Output is equivalent up to float precision.

    This transform does not support torchscript.


    Converts a PIL Image or numpy.ndarray (H x W x C) in the range
    [0, 255] to a torch.FloatTensor of shape (C x H x W) in the range [0.0, 1.0]
    if the PIL Image belongs to one of the modes (L, LA, P, I, F, RGB, YCbCr, RGBA, CMYK, 1)
    or if the numpy.ndarray has dtype = np.uint8

    In the other cases, tensors are returned without scaling.

    .. note::
        Because the input image is scaled to [0.0, 1.0], this transformation should not be used when
        transforming target image masks. See the `references`_ for implementing the transforms for image masks.

    .. _references: https://github.com/pytorch/vision/tree/main/references/segmentation
    ÚreturnNc                 óp   •— t          j        d¦  «         t          ¦   «                              ¦   «          d S )NzÕThe transform `ToTensor()` is deprecated and will be removed in a future release. Instead, please use `v2.Compose([v2.ToImage(), v2.ToDtype(torch.float32, scale=True)])`.Output is equivalent up to float precision.)ÚwarningsÚwarnÚsuperÚ__init__)ÚselfÚ	__class__s    €úy/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/torchvision/transforms/v2/_deprecated.pyr   zToTensor.__init__)   s:   ø€ ÝŒð:ñ	
ô 	
ð 	
õ
 	‰Œ×ÒÑÔÐÐÐó    ÚinptÚparamsc                 ó*   — t          j        |¦  «        S )N)Ú_FÚ	to_tensor)r   r   r   s      r   Ú	transformzToTensor.transform1   s   € ÝŒ|˜DÑ!Ô!Ð!r   )r	   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚPILÚImageÚnpÚndarrayÚ_transformed_typesr   r   ÚdictÚstrr   ÚtorchÚTensorr   Ú__classcell__)r   s   @r   r   r      s    ø€ € € € € ðð ð4 œ)œ/¨2¬:Ð6Ððð ð ð ð ð ð"˜e C¤I¤O°R´ZÐ$?Ô@ð "È$ÈsÐTWÈxÌ.ð "Ð]bÔ]ið "ð "ð "ð "ð "ð "ð "ð "r   r   )r   Útypingr   r   Únumpyr   Ú	PIL.Imager   r$   Útorchvision.transformsr   r   Útorchvision.transforms.v2r   r   © r   r   ú<module>r-      sŸ   ðØ €€€Ø Ð Ð Ð Ð Ð Ð Ð à Ð Ð Ð Ø Ð Ð Ð Ø €€€Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3à /Ð /Ð /Ð /Ð /Ð /ð&"ð &"ð &"ð &"ð &"ˆyñ &"ô &"ð &"ð &"ð &"r   