Ah. Is there a more “Pytorch” way to do this when loading an image from PIL. Something possible in one line, where I can assign requires grad = True as I do when creating new variables. I couldn’t find anything within the docs here:
https://pytorch.org/docs/stable/torchvision/transforms.html 5
I am currently using this transform:
transform = transforms.Compose([transforms.Resize((img_dim, img_dim)),
                                    transforms.ToTensor(), 
                                    transforms.Normalize([0.485, 0.456, 0.406],
                                                         [0.229, 0.224, 0.225])])
    

Currently my way of trying to load a PIL image as a trackable tensor seems very sloppy.