pil_to_tensor¶ torchvision.transforms.functional.pil_to_tensor(pic: Any) → Tensor[source]¶ 將 PIL Image 轉換為相同型別的張量。此函式不支援 torchscript。 有關更多詳細資訊,請參閱 PILToTensor。 注意 會執行底層陣列的深複製。 引數: pic (PIL Image) – 要轉換為張量的影像。 返回: 轉換後的影像。 返回型別: 張量