-
My question :- What is the difference between |
Beta Was this translation helpful? Give feedback.
Answered by
LuluW8071
May 1, 2024
Replies: 1 comment 1 reply
-
Both performs same function. The only difference lies in how you import import torchvision.transforms as transforms
import torch
# Using torchvision.transforms.ToTensor()
transform_1 = transforms.ToTensor()
image_tensor_1 = transform_1(pil_image)
# Using transform = ToTensor()
from torchvision.transforms import ToTensor
transform_2 = ToTensor()
image_tensor_2 = transform_2(pil_image) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
GAuravY19
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Both performs same function.
The only difference lies in how you import