title: Channelwise pooling in pytorch
body: <p>Given a tensor of size <code>[8, 64, 128, 128]</code> (B, CH, H, W), I would like to apply a channelwise 2D Max Pooling Operation over a 2x2x64 region (H, W, CH) with stride of 1, so as to obtain another tensor of size <code>[8, 1, 128, 128]</code>. Does the code below go onto the right direction?</p>
  <pre><code>import torch
  import torch.nn as nn
  
  torch.manual_seed(0)
  
  B, CH, H, W = 8, 64, 128, 128
  x_batch = torch.randn((B, CH, H, W))
  max3d = nn.MaxPool3d((64,2,2), stride=1)
  x_max = max3d(x_batch)
  x_max.shape
  
  </code></pre>
  <p>In addition, the code above results in <code>[8, 1, 127, 127]</code>, but I would like to exactly obtain a tensor of size <code>[8, 1, 128, 128]</code>. I was not able to find the proper padding yet, e.g. by using a <code>padding=(0,1,1)</code>, I obtain an output of <code>[8, 1, 129, 129]</code></p>