How to store switch locations during max-pooling layer
I am implementing the article https://arxiv.org/abs/1311.2901 by Zeiler and Fergus on visualizing and understanding convolutional Networks. To be able reflect hidden layers back to the image space we need deconvolution kernels, rectified linear functions and switch locations. I couldn't find how to store switch locations during max-pooling. I would be glad if you can explain how to do it in pytorch or tensorflow. Thanks in advance.

The pytorch max pool operation takes an optional argument return_indices which is set to False by default. If you set that to True, the output will be the max pooled tensor as well the indices of the maximum items.
