I need to forward a tensor [1, 3, 128, 128] representing a 128x128 rgb image into a
nn.Conv2d(128,128,1)

but I get the error
RuntimeError: Given groups=1, weight of size [128, 128, 1, 1], expected input[1, 3, 128, 128] to have 128 channels, but got 3 channels instead

PS: the image tensor is shaped as a 4d because the previous step is a nn.UpsamplingBilinear2d(size=None, scale_factor=2) which needs a 4d tensor as input