Suppose I have 2 3-D tensors A, and B and want to copy some elements from B into A. Specifically, I have two lists of the form [(x_1, y_1), (x_2, y_2), ...] and [(x'_1, y'_1), (x'_2, y'_2), ...] and I want to perform A[x_1, y_1, :] = B[x'_1, y'_1, :] and so on. Is there any fast way of doing this or is a for-loop the only way?
Also, will such an operation support the flow of gradients from A to elements copied from B?
Thanks!