Sure. Thanks! I just didn’t dare to, wondering instead why I need to torch.unsqueeze() single samples into tensors with singleton outer dimension prior to returning them from __getitem__().
Without unsqueeze(), I was getting the famous RuntimeError: Expected 4-dimensional input for 4-dimensional weight [4, 1, 3, 3], but got 3-dimensional input of size [64, 32, 32] instead from the very first layer, conv2d (3x3 to four features). The input is a 32x32 gray-scale image, batch_size is 64.