code: def test_recursion():
      """
      Program:
         def @f(%n: int32, %data: float32) -> float32 {
            if (%n == 0) {
                %data
            } else {
                @f(%n - 1, log(%data))
            }
         }
      """
      sb = relay.ScopeBuilder()
      f = relay.GlobalVar("f")
      ti32 = relay.scalar_type("int32")
      tf32 = relay.scalar_type("float32")
      n = relay.var("n", ti32)
      data = relay.var("data", tf32)
  
      with sb.if_scope(relay.equal(n, relay.const(0, ti32))):
          sb.ret(data)
      with sb.else_scope():
          sb.ret(
              f(
                  relay.subtract(n, relay.const(1, ti32)),
                  relay.log(data),
              )
          )
      mod = tvm.IRModule()
      mod[f] = relay.Function([n, data], sb.get())
      mod = infer_mod(mod)
      assert "@f(%1, %2)" in mod.astext()
      assert mod["f"].checked_type == relay.FuncType([ti32, tf32], tf32)
  
imports: import pytest
  import tvm
  from tvm import IRModule, parser, relay, te
  from tvm.relay import analysis, op, transform
  from tvm.relay.op import op
  import numpy
label_desc: Use image node_id 10 for calling a global function with example usage: test_recursion() without return types