This code works for me, so you might need to update PyTorch and torchvision:
transform = transforms.Compose(
    [transforms.RandomHorizontalFlip(p=0.2),
    transforms.ColorJitter(brightness=.5, hue=.1),
    transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])

x = torch.randn(32, 3, 64, 64)
out = transform(x)
print(out.shape)
> torch.Size([32, 3, 64, 64])




 D_B:

Why is there even such difference between accepting PIL or tensor types? This makes everything so much harder


The ability to apply torchvision.transforms on tensors is relatively new and makes it easier now.