code: def test_allocate():
      @te.hybrid.script
      def blur2d(a):
          b = output_tensor((30, 30), "float32")
          for i in range(30):
              ha = allocate((3, 30), "float32")
              for j in range(3):
                  for k in range(30):
                      ha[j, k] = (
                          a[i + j, k]
                          + a[i + j, k + 1]
                          + a[i + j, k + 2]
                      )
              for j in range(30):
                  b[i, j] = (ha[0, j] + ha[1, j] + ha[2, j]) / 9.0
          return b
  
      a = te.placeholder((32, 32), "float32", "a")
      b = blur2d(a)
      sch = te.create_schedule(b.op)
      func, ins, outs = run_and_check(blur2d, [a])
      run_and_check(func, ins, outs=outs)
  
      @te.hybrid.script
      def share_vec_add(a, b):
          c = output_tensor((256,), "float32")
          shared = allocate((256,), "float32", "shared")
          for i in bind("threadIdx.x", 256):
              shared[i] = a[i]
          local = allocate((256,), "float32", "local")
          for i in bind("threadIdx.x", 256):
              local[i] = b[i]
          for i in bind("threadIdx.x", 256):
              c[i] = shared[i] + local[i]
          return c
  
      a = te.placeholder((256,), dtype="float32", name="a")
      b = te.placeholder((256,), dtype="float32", name="b")
      c = share_vec_add(a, b)
      func, ins, outs = run_and_check(
          share_vec_add, [a, b], target="cuda"
      )
      run_and_check(func, ins, outs=outs, target="cuda")
  
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 10 for calling a global function with example usage: test_allocate() and returns: b, c