In the traditional pooling layer, the side length during pooling is fixed.
At present, I want to try to implement pooling with variable side length, tentatively called “soft pooling”.
The details are as follows.

traditional pooling930×520 9.88 KB

traditional pooling

soft pooling930×520 9.94 KB

“soft pooling”
How can I implement such a model layer?