'Calculates the summation of the elements along the specified axis.
Arguments:
a (Tensor): the Tensor on which to perform the sum
axis (int, optional): the dimension along which to compute.
If set to None, we will sum over all
dimensions.
out (Tensor, optional): where the result will be stored. If out is
None, only the op-tree will be returned.
keepdims (bool, optional): Keep the axes being computed over in the
output (with size 1), instead of
collapsing.  Defaults to True.
Returns:
OpTreeNode: the resulting op-tree'

def sum(self, a, axis=None, out=None, keepdims=True):

    if (axis is None):
        return OpTreeNode.build('sum', OpTreeNode.build('sum', a, None, axis=0), None, axis=1, out=out)
    return OpTreeNode.build('sum', a, None, axis=axis, out=out)
