I got confused when I was trying to use maxpool2d. The input should be (batch_size, channels, height, width), and I thought the pooling kernel is sliding over (channel, height, width), which means it will find a max value to represent the entities of (channel, height, width) range. To be more specific, when I use a (20, 1, 1) kernel (say I have 20 channels in my input data and batch size is 1), and the output should be (1, 1, height, width). But when I look into the pytorch docs, the kernel doesn’t slide over the channels dimension. So I am really confused. I will appreciate it if anyone could answer my question.