I have a 3 dimension vector. I would like to perform a 1d max pool on the second dimension.
According to the documentation of pytorch the pooling is always performed on the last dimension.
For example:
>>> x = torch.rand(5, 64, 32)
>>> pool = nn.MaxPool1d(2, 2)
>>> pool(x).shape
torch.Size([5, 64, 16])
My desired output:
torch.Size([5, 32, 32])
How can i do that?