예제 #1
0
def test_double():
    mod = Module()
    p = Prelude(mod)
    add_nat_definitions(p)
    orig = p.double(make_nat_expr(p, 3))
    res = dcpe(orig, mod=mod)
    assert alpha_equal(res, make_nat_expr(p, 6))
예제 #2
0
def test_double():
    mod = tvm.IRModule()
    p = Prelude(mod)
    add_nat_definitions(p)
    orig = p.double(make_nat_expr(p, 3))
    orig = Function([], orig)
    res = dcpe(orig, mod=mod)
    assert tvm.ir.structural_equal(res.body, make_nat_expr(p, 6))