pil_to_tensor¶
-
torchvision.transforms.functional.pil_to_tensor(pic)[source]¶ Convert a
PIL Imageto a tensor of the same type. This function does not support torchscript.See
PILToTensorfor more details.Note
A deep copy of the underlying array is performed.
- Parameters
pic (PIL Image) – Image to be converted to tensor.
- Returns
Converted image.
- Return type
Tensor