Ah…the 112  are not channels but height (and width) of the image. There are only 3 channels in the image ( red, green and blue). Pytorch expects channels to be the 1st dimension (0th dimension is batch dimension), 2nd dimension to be height and 3rd to be width…So we need to transpose the image to get channels first…