code: def test_local_recursion():
      mod = tvm.IRModule()
      p = Prelude(mod)
      _, cons, nil = p.mod.get_type("List")
  
      v = relay.Var("v")
      h = relay.Var("h")
      t = relay.Var("t")
      f = relay.Var("f")
  
      # just returns the same list
      let = relay.Let(
          f,
          relay.Function(
              [v],
              relay.Match(
                  v,
                  [
                      relay.Clause(
                          relay.PatternConstructor(
                              cons,
                              [
                                  relay.PatternVar(h),
                                  relay.PatternVar(t),
                              ],
                          ),
                          cons(h, f(t)),
                      ),
                      relay.Clause(
                          relay.PatternConstructor(nil, []), nil()
                      ),
                  ],
              ),
          ),
          f(
              cons(
                  relay.const(1),
                  cons(relay.const(2), cons(relay.const(3), nil())),
              )
          ),
      )
  
      val = run_as_python(let, mod)
      assert_constructor_value(val, cons, 2)
      assert_tensor_value(val.fields[0], 1)
      assert_constructor_value(val.fields[1], cons, 2)
      assert_tensor_value(val.fields[1].fields[0], 2)
      assert_constructor_value(val.fields[1].fields[1], cons, 2)
      assert_tensor_value(val.fields[1].fields[1].fields[0], 3)
      assert_constructor_value(
          val.fields[1].fields[1].fields[1], nil, 0
      )
  
imports: import numpy
  import tvm
  from tvm import te
  from tvm import relay
  from tvm.relay.testing import run_as_python
  from tvm.relay.prelude import Prelude
  from tvm.runtime.container import ADT
  from tvm.relay.backend.interpreter import RefValue, ConstructorValue
label_desc: Use image node_id 24 for calling a global function with example usage: test_local_recursion() without return types