def test_expressions():
    exprs = [
        lambda a, b, c: a + b + c,
        lambda a, b, c: a - b - c,
        lambda a, b, c: a * b * c,
        lambda a, b, c: a / b / c,
        lambda a, b, c: a + b - c,
        lambda a, b, c: b + c - a,
        lambda a, b, c: a + b + (-c),
        lambda a, b, c: a + b*a + c,
        lambda a, b, c: a + b**2 + c,
        lambda a, b, c: a + b*b + a*b + c,
        lambda a, b, c: a + 2*(b + a) + c,
        lambda a, b, c: c / (a + ((b/1)*(c+1)) + a*b*c),
    ]
    confs = itertools.product(shapes, exprs)
    for shape, op in confs:
        a_array = np.random.normal(size=shape).astype(dp.float_)
        b_array = np.random.normal(size=shape).astype(dp.float_)
        c_array = np.random.normal(size=shape).astype(dp.float_)
        a_src = BPropableSource(a_array)
        b_src = BPropableSource(b_array)
        c_src = BPropableSource(c_array)
        sink = op(a_src, b_src, c_src)

        for src, x0 in [(a_src, a_array), (b_src, b_array), (c_src, c_array)]:
            f, f_grad = graph_funs(src, sink)
            g_approx = approx_fprime(x0, f)
            g_true = f_grad(x0)
            assert gradclose(g_true, g_approx)
dataset/ETHPy150Open andersbll/deeppy/test/unit/expr/test_elementwise.py/test_expressions/swapped operands of `-`