Hi,
I think it depends on the ToPILImage instead of ToTensor:
https://pytorch.org/docs/stable/torchvision/transforms.html#torchvision.transforms.ToPILImage 65

if the input has 1 channel, the mode is determined by the data type (i,e, int , float , short )

Maybe you can assign the mode you want:
https://pillow.readthedocs.io/en/latest/handbook/concepts.html#modes 32