Hi, I’m trying to use index tensor to assign value to another tensor. In particular, I have tensor A of shape [a,b,c] and index tensor B of shape [a,b].

I have a value tensor C of shape [b]

I want to assign values such that A[i,j,B[i,j]] = C[j].

I tried using a for loop but it’s too slow. Is there a proper approach to do this ? (I also checked some tutorial on tensor indexing e.g. here and here but they aren’t relatable)