code: def test_recursive():
      mod = tvm.IRModule()
  
      x = relay.var("x", shape=(2,))
      i = relay.var("i", shape=(), dtype="int32")
      s = relay.var("s", shape=(2,))
      cond = i < relay.const(10, dtype="int32")
  
      loop = relay.var("while_loop")
      sb = relay.scope_builder.ScopeBuilder()
      with sb.if_scope(cond):
          ii = i + relay.const(1, dtype="int32")
          ss = s + x
          sb.ret(loop(ii, ss))
      with sb.else_scope():
          sb.ret(s)
      func = relay.Function([i, s], sb.get())
  
      ret = relay.Let(
          loop,
          func,
          loop(
              relay.const(0, dtype="int32"),
              relay.zeros(shape=(2,), dtype="float32"),
          ),
      )
      mod["main"] = relay.Function([x], ret)
  
      mod = relay.transform.InferType()(mod)
      new_mod = transform.LambdaLift()(mod)
      assert len(new_mod.functions) == 2
  
file_path: tvm/tests/python/relay/test_pass_lambda_lift.py
imports: import numpy
  import pytest
  import tvm
  from tvm import te
  from tvm import relay
  from tvm.relay import transform
label_desc: Use image node_id 3 for calling a global function with example usage: test_recursive() without return types