code: def test_downstream():
      @te.hybrid.script
      def downstream(a):
          b = output_tensor((20,), "float32")
          for i in range(20):
              b[i] = a[i] * i
          return b
  
      a = te.placeholder((20,), "float32")
      b = downstream(a)
      c = te.compute((20,), lambda x: b[x] + 1.0)
  
      sch = te.create_schedule(c.op)
      module = tvm.build(sch, [a, c])
      assert module
  
      a = numpy.random.randn(20).astype("float32")
      ref = numpy.zeros((20,)).astype("float32")
      for i in range(20):
          ref[i] = (a[i] * i) + 1.0
  
      tvm_a = tvm.nd.array(a)
      tvm_c = tvm.nd.array(numpy.zeros((20,)).astype("float32"))
      module(tvm_a, tvm_c)
      tvm.testing.assert_allclose(tvm_c.numpy(), ref, 1e-5, 1e-5)
  
imports: import tvm, inspect, sys, traceback, numpy, pytest, types, os
  from tvm import te
  from tvm.contrib import utils
  from tvm.te.hybrid import script
  from tvm.te.hybrid.runtime import HYBRID_GLOBALS
  import tvm.testing
label_desc: Use image node_id 12 for calling a global function with example usage: test_downstream() and returns: b