Can you try something like:

import torch as pt
aa = pt.tensor([[1,2,3],[4,5,6],[7,8,9]])
idx = [i for i in range(aa.size(0)-1, -1, -1)]
idx = pt.LongTensor(idx)
inverted_tensor = pt.index_select(aa,0,idx)
print(“Before ::”,aa)
print(“After ::”,inverted_tensor)