Sorry, what version of pytorch are you using? I’m on master and I’ve gotten the following to work:
In [19]: X = torch.randn(3, 3)

In [20]: a = torch.LongTensor([1, 2, 0])

In [21]: b = torch.LongTensor([0, 1, 2])

In [22]: X[a, b]
Out[22]:

 0.3087
-0.6228
-0.5091

I can also assign X[a, b] = 0.