Solved by ptrblck in post #2 
              
              
                Most image transformations are defined for PIL.Images. 
You could add transforms.ToPILImage() as the first transformation, which will add a small overhead, but allows you to use any torchvision.transforms.