Greetings!
I am trying to preprocess RGB images to create batches of the correct shape (as required by my network).
Example: CIFAR10
transfos = transforms.Compose([torchvision.transforms.Grayscale(),transforms.ToTensor(),transforms.Normalize((0.4749), (0.2382))])
train = datasets.CIFAR10(".", train = True, download = True, transform = transfos)
test = datasets.CIFAR10(".", train = False, download = True, transform = transfos)

batches_train = torch.utils.data.DataLoader(train, batch_size=bs, shuffle=True)
batches_test = torch.utils.data.DataLoader(test, batch_size=bs, shuffle=True)

The problem now is that each batch has dimension (batchsize, 1, H, W).
For all batches, I would like to have the dimension (batchsize, H*W). Is there a simple way to use transforms to do this?
Thank you!
PiF