'How can reshape 2d tensor to 1d

tensor([[0, 5],
        [1, 4],
        [2, 2],
        [4, 2],
        [7, 9],
        [2, 0]) 

I want to reshape this tensor to

tensor([[5],
        [14],
        [22],
        [42],
        [79],
        [20])

how can i solve this problem? please help me



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source