Is there a more elegant and faster solution to the problem than running your own loop? vector = torch.FloatTensor([1, 2, 3, 4]) answer = 1*2 + 1*3 + 1*4 + 2*3 + 2*4 + 3*4 I did not find a suitable one from the TORCH methods. I don't think it's a good idea to run my cycles. Continue reading...