Ashutosh_Mishra:

Apart from it, the transforms compose is the standard class which is used to compose different transformations.


It’s not completely identical, since you are using *args instead of img, which will unwrap the image tensor.
I.e. the error is raised in the second transformation, which will use args to pass an image tensor in the shape [channels, height, width] to Normalize. Using t(*args) will unwrap the image tensor in dim0 and if it’s containing 3 channels, you’ll get the raised error.
What’s your use case to reimplement transforms.Compose in this way?