I want to index a two-dimension tensor like I do in numpy.
a = torch.rand(5,5)
b = b = torch.LongTensor([4,3,2,1,0])
a[b,b] gives an error:
TypeError: indexing a tensor with an object of type LongTensor. The only supported types are integers, slices, numpy scalars and torch.LongTensor or torch.ByteTensor as the only argument.
How do I index a two-dimension tensor using other two tensors?