def test_unary():
    ops = [
        ex.Absolute, ex.Negative, ex.Log, ex.Exp, ex.Tanh,
    ]
    confs = itertools.product(shapes, ops)
    for shape, op in confs:
        print((op.__name__.ljust(20), shape) % '%s shape=%s')
        src_array = np.random.normal(size=shape).astype(dp.float_)

        if op is ex.Log:
            src_array = np.fabs(src_array) + eps

        src = BPropableSource(src_array)
        sink = op()(src)
        f, f_grad = graph_funs(src, sink)
        g_approx = approx_fprime(src_array, f)
        g_true = f_grad(src_array)
        assert gradclose(g_true, g_approx)
dataset/ETHPy150Open andersbll/deeppy/test/unit/expr/test_elementwise.py/test_unary/swapped operands of `%`