different implementation of average pooling