You can’t tell nn.Conv2d that the channels are in another dimension. You would rather permute your input to match the expected dimensions. Also, nn.Conv2d expects a 4-dimensional input and your example is missing the batch dimension.
In case your current input would have the shape [batch_size, height, width, channels], just use x = x.permute(0, 3, 1, 2).