to_tensor¶
-
torchvision.transforms.functional.to_tensor(pic)[source]¶ Convert a
PIL Imageornumpy.ndarrayto tensor. This function does not support torchscript.See
ToTensorfor more details.- Parameters
pic (PIL Image or numpy.ndarray) – Image to be converted to tensor.
- Returns
Converted image.
- Return type
Tensor