Hi, now I need to sum all probability with same index together for my modified pointer network. which means
prob = Variable(torch.Tensor(len, batch)) indices = Variable(torch.LongTensor(len, batch)) output = Variable(torch.zeros(len, batch,vsize)) for pos in range(len): for b in range(batch): output[pos][b][indices[pos,b]] += prob[pos][b]
but this implementation is too brutal， How can I do this without for-loop? thanks very much!