I would like to get this result with torch functions. Do you have suggestions?
import torch
test_tensor=torch.tensor([[1, 2, 3, 4, 5, 6],
[7, 8, 9, 10, 11, 12]]
)
print(test_tensor)
'''
I would like to get:
t_1 = torch.tensor([[6], #1+2+3
[24]])#7+8+9
t_2 = torch.tensor([[9], #1+3+5
[27]])#7+9+11
'''