PILToTensor
- class torchvision.transforms.v2.PILToTensor[source]
Convert a PIL Image to a tensor of the same type - this does not scale values.
This transform does not support torchscript.
Convert a PIL Image with H height, W width, and C channels to a Tensor of shape (C x H x W).
Example
>>> from PIL import Image >>> from torchvision.transforms import