import torch
import torch.nn as nn
input = torch.randn(3,64,64).cpu() #.cuda()
print(input.size()) # Works
test = input[:, [1,-2], [1,-2]]
print(test)
And I run into the following error:
(3L, 64L, 64L)
Traceback (most recent call last):
File "t.py", line 6, in <module>
test = input[:, [1,-2], [1,-2]]
RuntimeError: index out of range at /pytorch/torch/lib/TH/generic/THTensorMath.c:277