code: def with_tvm(lam, *args):
      """Take numpy arrays as args, convert them to TVM tensors and call `lam`.
      Result of lambda is converted back to numpy array and returned.
      """
      dev = tvm.cpu(0)
      pls = []  # placeholders
      vals_nd = []  # initial values
      for i, arg in enumerate(args):
          pls.append(te.placeholder(arg.shape, name="pl" + str(i)))
          vals_nd.append(tvm.nd.array(arg, dev))
  
      out = lam(*pls)
      out_nd = tvm.nd.array(
          np.zeros(get_const_tuple(out.shape), dtype=out.dtype), dev
      )
      s = te.create_schedule([out.op])
      m = tvm.build(s, pls + [out], "llvm")
      m(*(vals_nd + [out_nd]))
      return out_nd.numpy()
  
file_path: tvm/tests/python/topi/test_topi_matmul.py
imports: import numpy
  import tvm
  import tvm.testing
  from tvm import te
  from tvm import topi
  from tvm.topi.utils import get_const_tuple
label_desc: Use image node_id 1 for calling a global function with example usage: with_tvm(lam) and returns: out_nd