code: def test_loop():
      mod = tvm.IRModule({})
      sum_up = relay.GlobalVar("sum_up")
      i = relay.var("i", shape=[], dtype="int32")
      accum = relay.var("accum", shape=[], dtype="int32")
      sb = ScopeBuilder()
      with sb.if_scope(relay.equal(i, relay.const(0, "int32"))):
          sb.ret(accum)
      with sb.else_scope():
          one_less = relay.subtract(i, relay.const(1, "int32"))
          new_accum = relay.add(accum, i)
          sb.ret(relay.Call(sum_up, [one_less, new_accum]))
      func = relay.Function([i, accum], sb.get())
      mod[sum_up] = func
      mod = transform.InferType()(mod)
      loop_bound = 0
      i_data = np.array(loop_bound, dtype="int32")
      accum_data = np.array(0, dtype="int32")
      iarg = relay.var("i", shape=[], dtype="int32")
      aarg = relay.var("accum", shape=[], dtype="int32")
      mod["main"] = relay.Function([iarg, aarg], sum_up(iarg, aarg))
  
      result = get_serialized_output(mod, i_data, accum_data)
      tvm.testing.assert_allclose(
          result.numpy(), sum(range(1, loop_bound + 1))
      )
  
imports: import pytest
  import numpy
  import tvm
  from tvm.runtime import vm
  from tvm.relay import vm
  from tvm import relay
  from tvm.relay.scope_builder import ScopeBuilder
  from tvm.relay import transform
  from tvm.relay.prelude import Prelude
  from tvm.contrib import utils
  from tvm.relay import testing
label_desc: Use image node_id 8 for calling a global function with example usage: test_loop() without return types