class_docstr: [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)])``.
  
  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
code: def __init__(self) -> None:
      warnings.warn(
          "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)])`."
      )
      super().__init__()
  
file_path: vision/torchvision/transforms/v2/_deprecated.py
imports: import warnings
  from typing import Any, Dict, Union
  import numpy
  import PIL.Image
  import torch
  from torchvision.transforms import functional
  from torchvision.transforms.v2 import Transform
label_desc: Use image node_id 1 to create a new ToTensor object from inherited base classes: Transform with example: obj = ToTensor()