y=lab.sum(x) returns a tensor y of the sum of the elements in each column of x.

y=lab.sum(x,2) performs the sum operation for each row and y=lab.sum(x,n) performs the sum operation over the dimension n.