code: def _arg_to_ast(mod, arg):
      if isinstance(arg, nd.NDArray):
          return Constant(arg.copyto(nd.cpu(0)))
      elif isinstance(arg, container.ADT):
          return Tuple([_arg_to_ast(mod, field) for field in arg])
      elif isinstance(arg, tuple):
          return Tuple([_arg_to_ast(mod, field) for field in arg])
      elif isinstance(arg, RefValue):
          return RefCreate(_arg_to_ast(mod, arg.value))
      elif isinstance(arg, ConstructorValue):
          return Call(
              mod.get_constructor(arg.tag),
              [_arg_to_ast(mod, field) for field in arg.fields],
          )
      elif isinstance(arg, np.ndarray):
          return Constant(nd.array(arg))
      elif isinstance(arg, Constant):
          return arg
      else:
          return const(arg)
  
imports: from __future__ import absolute_import
  import numpy
  import tvm._ffi
  from tvm.runtime import container, Object
  from .None import _backend
  from ..None import _make, analysis
  from ...None import nd
  from ..expr import Tuple, RefCreate, Call, Constant, GlobalVar, const
  from ..function import Function
  from ..scope_builder import ScopeBuilder
label_desc: Use image node_id 1 for calling a global function with example usage: _arg_to_ast(mod, arg) and returns: Constant, Tuple, Tuple, RefCreate, Call, Constant, arg, const