I have two pytorch tensors:
Xwith shape(A, B, C, D)Iwith shape(A, B)
Values in I are integers in range [0, C).
What is the most efficient way to get tensor Y with shape (A, B, D), such that:
Y[i][j][k] = X[i][j][ I[i][j] ][k]
from Index pytorch 4d tensor by values in 2d tensor
No comments:
Post a Comment