torchvision.transforms.v2.functional.pil_to_tensor torchvision.transforms.v2.functional.pil_to_tensor(pic: Any) → Tensor[source] Convert a PIL Image to a tensor of the same type. This function does not support torchscript. See for more details.