Something like that
result = transforms.Compose([
            transforms.toPILImage(),
            transforms.Grayscale(num_output_channels=1),
            transforms.ToTensor(),
            transforms.Normalize([134.96,], [2.077,])
        ])(img)

img is a three channel image btw