@ptrblck
A = .. # A is of shape [batch_size x len , embedding]
target_embeddings = []
len = A.shape[1]
for i in range(batch_size):
 for index in range(len):
  tmp = A[i , index , :]
  target_embeddings.append(torch.roll(tmp , index , 0))

#do torch.stack thing to get a tensor like object back