If A
, B
are LongTensor
, with the size of H*W*2
, how can I make:
A[B[j,k,0],B[j,k,1]] = j,k
and when it comes to A
, B
are LongTensor
, with the size of B*H*W*2
, how can I achieve the same operation quickly?
A[0,B[0,j,k,0],B[0,j,k,1]] = j,k
A[1,B[1,j,k,0],B[1,j,k,1]] = j,k
...
A[B,B[1,j,k,0],B[B,j,k,1]] = j,k