How to index a Variable with two LongTensor

Hello, everyone! In pytorch 0.2 you can index a Variable X by X[a, b] where a and b are both LongTensor of same size. But how can I do it in pytorch 0.1.12 version? I still can not find a way to achieve it.

Since pytorch 0.1.12 is an older version, it is probably the case that the indexing by long tensor feature wasn’t implemented back then. You should use the more recent version of pytorch; they come with a lot of bugfixes and performance improvements.

Is there anything preventing you from just using 0.2 instead of 0.1?

That is ok! But I still doubt if using X[a, b] to index a variable will influence the autograd. Is there any function to do this? I have seen someone said that scatter_add can achieve this goal, but I dont find the function in pytorch api doc.