Some of the images I have in the dataset are gray-scale, thus, I need to convert them to RGB, by replicating the gray-scale to each band. I am using a transforms.lambda  to do that, based on torch.cat. However, this seems to not give the expected results
Example: Let xx be some image of size 28x28, then,
In [67]: xx.shape
Out[67]: torch.Size([28, 28])

In [68]: y =torch.cat([xx,xx,xx],0)

In [69]: y.shape
Out[69]: torch.Size([84, 28])

I expected the size to be [28, 28, 3]. Any suggestions how to resole this?
Here’s the transform I am trying:
transform = transforms.Compose([
                transforms.ToTensor(), 
                transforms.Lambda(lambda x: torch.cat([x, x, x], 0)),
                transforms.Normalize(mean, std),
                 ])