Example #1
0
def step_cconv(resources, graph, use_llift):
    if use_llift:
        graph.manager.keep_roots(graph)
        llift = LambdaLiftRewriter(resources.opt_manager)
        llift.run()
    closure_convert(graph)
    return {"graph": graph}
Example #2
0
def test_return_closure_partial():
    """Return a closure (after closure conversion)."""
    @parse
    def f(x, y):
        def g():
            return x + y

        return g

    f = clone(closure_convert(f))
    f = compile(f)

    g = f(4, 5)
    assert g() == 9
Example #3
0
def step_cconv(graph):
    closure_convert(graph)
    return {"graph": graph}
Example #4
0
def step_cconv(graph):
    closure_convert(graph)
    return {'graph': graph}