I want to copy tensor elements to another tensor at positions given by indices along given dimension.
Example:
A = [[3, 2, 1], [2, 4, 5], [6, 3, 2]]
B = [X, Y, Z]
Index = [0, 2, 1]
Dim = 1
Result should be: [[X, 2, 1], [2, 4, Y], [6, Z, 2]]
What’s the best way to achieve this?