If I understand the question correctly, the out should be:
out = [2,6]
and can be done like:
x = torch.tensor([[1,2,3], [4,5,6], [7,8,9]])
row = torch.tensor([0,1])
col= torch.tensor([1,2])
res=[]
for idx in range(len(row)):
    res.append(x[row[idx]][col[idx]])
print(res)
out = torch.tensor(res)
print(out)

[tensor(2), tensor(6)]
tensor([2, 6])