Hi 07hyx06!



 07hyx06:

C = []
for i in range(len(B)):
    C.append(A[B[i][0]][B[i][1]])
C = torch.tensor(C)

I wonder if there exists some Pytorch API equivalent to the above code segment?


Yes:
A[B[:, 0], B[:, 1]]

Best.
K. Frank