@shubhvachher @etekiller
Thanks a lot. actually, I want to convert MNIST-M channel 3 to 1.
Easiest way to make this is using transforms.Compose() like this.
    pre_process = transforms.Compose(
        [transforms.Grayscale(num_output_channels=1), transforms.ToTensor(),
         transforms.Normalize(mean=[0.5], std=[0.5])])


But I have to do this in dataloader for loop statement, so I write like this.
and  there are some differences between two methods.
    pre_process = transforms.Compose(
        [transforms.ToTensor(),
         transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])])

    for i, (images, labels) in enumerate(loader_mnistm):
        images, labels = images.to(device), labels.to(device)

        images = images.cpu()
        images = [torchvision.transforms.ToPILImage()(x) for x in images]
        images = [torchvision.transforms.Grayscale()(x) for x in images]
        images = [torchvision.transforms.ToTensor()(x) for x in images]
        images = torch.stack(images).to(device)


What`s wrong with my code?