No, AdaptiveMaxPooling does not fit my scheme. I would like to explicitly choose/mask the neurons which are considered by each sliding of the kernel.
Perhaps I’m just a beginner with PyTorch, but my current problem stems from the fact that I cannot find how to write an explicit backward() for max_pool2d. I think if found a way to do that, I can implement my custom pooling based on it.