code: def test_function_taking_adt_ref_tuple():
      mod = tvm.IRModule()
      prelude = relay.prelude.Prelude(mod)
      _, cons, nil = prelude.mod.get_type("List")
  
      nil_value = ConstructorValue(nil.tag, [], nil)
      cons_value = ConstructorValue(
          cons.tag,
          [
              nd.array(np.random.rand(1, 10).astype("float32")),
              nil_value,
          ],
          cons,
      )
  
      ref_value = RefValue(
          nd.array(np.random.rand(1, 10).astype("float32"))
      )
      tuple_value = container.tuple_object(
          [
              nd.array(np.random.rand(1, 10).astype("float32"))
              for _ in range(10)
          ]
      )
  
      id_func = relay.create_executor(mod=mod).evaluate(prelude.id)
  
      res_nil = id_func(nil_value)
      assert res_nil.tag == nil_value.tag
      assert len(res_nil.fields) == 0
  
      res_cons = id_func(cons_value)
      assert res_cons.tag == cons_value.tag
      assert len(res_cons.fields) == len(cons_value.fields)
      testing.assert_allclose(
          res_cons.fields[0].numpy(), cons_value.fields[0].numpy()
      )
      assert isinstance(res_cons.fields[1], ConstructorValue)
      assert res_cons.fields[1].tag == nil.tag
      assert len(res_cons.fields[1].fields) == 0
  
      res_ref = id_func(ref_value)
      testing.assert_allclose(
          res_ref.value.numpy(), ref_value.value.numpy()
      )
  
      res_tuple = id_func(tuple_value)
      for i in range(10):
          testing.assert_allclose(
              res_tuple[i].numpy(), tuple_value[i].numpy()
          )
  
imports: import numpy
  import pytest
  import tvm
  from tvm import testing
  from tvm import nd
  from tvm import relay
  from tvm.runtime import container
  from tvm.relay.backend.interpreter import RefValue, ConstructorValue
  from tvm.relay.scope_builder import ScopeBuilder
label_desc: Use image node_id 14 for calling a global function with example usage: test_function_taking_adt_ref_tuple() without return types