How to perform sum pooling?

You can view the feature map as a 1d tensor, and call sum on it.