Solved by tom in post #2 
              
              
                Hello, 
thank you for asking! 
Stochastic pooling as in the paper with stride = pool size  is easy to implement using view (so that the indices to be pooled are in their own dimension e.g. x.view(x.size(0),x.size(1)//2,2)), sampling random coordinates from multinomial and using that for indexing. 
T…