'Reduces the atom to an affine expression and list of constraints.
Parameters
arg_objs : list
LinExpr for each argument.
size : tuple
The size of the resulting expression.
data :
Additional data required by the atom.
Returns
tuple
(LinOp for objective, list of constraints)'

@staticmethod
def graph_implementation(arg_objs, size, data=None):

    x = arg_objs[0]
    axis = data[0]
    t = lu.create_var(size)
    if (axis is None):
        prom_t = lu.promote(t, x.size)
        expr = lu.sub_expr(x, prom_t)
        (obj, constraints) = exp.graph_implementation([expr], x.size)
        obj = lu.sum_entries(obj)
    elif (axis == 0):
        prom_size = (x.size[0], 1)
        ones = lu.create_const(np.ones(prom_size), prom_size)
        prom_t = lu.mul_expr(ones, t, x.size)
        expr = lu.sub_expr(x, prom_t)
        (obj, constraints) = exp.graph_implementation([expr], x.size)
        const_size = (1, x.size[0])
        ones = lu.create_const(np.ones(const_size), const_size)
        obj = lu.mul_expr(ones, obj, size)
    else:
        prom_size = (1, x.size[1])
        ones = lu.create_const(np.ones(prom_size), prom_size)
        prom_t = lu.rmul_expr(t, ones, x.size)
        expr = lu.sub_expr(x, prom_t)
        (obj, constraints) = exp.graph_implementation([expr], x.size)
        const_size = (x.size[1], 1)
        ones = lu.create_const(np.ones(const_size), const_size)
        obj = lu.rmul_expr(obj, ones, size)
    ones = lu.create_const(np.ones(size), size)
    constraints += [lu.create_leq(obj, ones)]
    return (t, constraints)
