MaxPool3d(return_indices=True) returns junk indices, both on CPU and GPU.
Here is an example:
pool3d = nn.MaxPool3d(kernel_size=2,stride=2,return_indices=True)
img3d = Variable(torch.rand(1,1,4,4,4))
out, indices = pool3d(img3d)
print(indices)
The output looks like this:
Variable containing:
(0 ,0 ,0 ,.,.) =
4.6117e+18 4.6117e+18
4.2950e+09 2.3224e+18
(0 ,0 ,1 ,.,.) =
4.2950e+09 4.2950e+09
-8.9845e+18 4.2950e+09
[torch.LongTensor of size 1x1x2x2x2]