code: def test_local_stage_predicate():
      m = 1
      n = 3
      p = 2
      A = tvm.te.placeholder((m, n, p), name="A")
      B = tvm.te.compute(
          (m, n, p), lambda bi, bj, bk: A[bi, bj, bk], name="B"
      )
      C = tvm.te.compute(
          (m, n, p), lambda ci, cj, ck: B[ci, cj, ck], name="C"
      )
      by = tvm.te.thread_axis("blockIdx.y")
      tx = tvm.te.thread_axis("threadIdx.x")
      vx = tvm.te.thread_axis("vthread")
  
      def schedule(thread_tag, mem_scope):
          s = tvm.te.create_schedule(C.op)
          s[B].compute_at(s[C], s[C].op.axis[0])
          s[B].set_scope(mem_scope)
          bno, bni = s[B].split(s[B].op.axis[1], n)
          bx = tvm.te.thread_axis("blockIdx.x")
          s[C].bind(s[C].op.axis[0], bx)
          s[C].bind(s[C].op.axis[1], thread_tag)
          s[B].bind(bni, thread_tag)
          return s
  
      def collect_visit(stmt, f):
          ret = []
          tvm.tir.stmt_functor.post_order_visit(
              stmt, lambda x: ret.append(f(x))
          )
          return ret
  
      # local vs. threadIdx
      s = schedule(tx, "local")
      lowered_body = tvm.lower(s, [A, C])["main"].body
      assert not any(
          collect_visit(
              lowered_body, lambda x: isinstance(x, tvm.tir.IfThenElse)
          )
      )
      # local vs. vthread
      s = schedule(vx, "local")
      lowered_body = tvm.lower(s, [A, C])["main"].body
      assert not any(
          collect_visit(
              lowered_body, lambda x: isinstance(x, tvm.tir.IfThenElse)
          )
      )
      # shared vs. blockIdx
      s = schedule(by, "shared")
      lowered_body = tvm.lower(s, [A, C])["main"].body
      assert not any(
          collect_visit(
              lowered_body, lambda x: isinstance(x, tvm.tir.IfThenElse)
          )
      )
  
imports: import numpy
  import tvm
  from tvm import te
  from tvm.driver.build_module import schedule_to_module
label_desc: Use image node_id 27 for calling a global function with example usage: test_local_stage_predicate() and returns: s, ret