code: def test_scan():
      m = te.var("m")
      n = te.var("n")
      x = te.compute(
          (m, n), lambda i, j: tvm.tir.const(1, "float32"), name="x"
      )
      s_state = te.placeholder((m, n))
      s_init = te.compute((1, n), lambda _, i: x[0, i], name="s_init")
      x_trans = te.compute(
          (m, n), lambda i, j: x[i, j] + 1, name="x_trans"
      )
      s_up1 = te.compute(
          (m, n), lambda t, i: s_state[t - 1, i] + 1, name="up1"
      )
      s_update = te.compute(
          (m, n),
          lambda t, i: s_up1[t, i] + x_trans[t, i],
          name="update",
      )
      s_scan = tvm.te.scan(s_init, s_update, s_state)
  
      def test_getbody():
          body = tvm.te.schedule.ScanGetBody(s_scan.op)
          assert set(body) == set([s_scan.op, s_update.op, s_up1.op])
  
      def test_attach_path():
          s = te.create_schedule(s_scan.op)
          s[x_trans].compute_at(s[s_update], s_update.op.axis[0])
          apath = tvm.te.schedule.CreateAttachPath(s)
          assert tuple(apath[s_update.op]) == tuple(
              [s_scan.op.scan_axis]
          )
          assert tuple(apath[x_trans.op]) == tuple(
              [s_update.op.axis[0], s_scan.op.scan_axis]
          )
  
      def test_fix_pt():
          body = tvm.te.schedule.ScanGetBody(s_scan.op)
          fxpt = tvm.te.schedule.ScanFixPointAnalysis(s_scan.op)
          assert fxpt[s_scan.spatial_axis_[0]].value != 0
  
imports: import tvm
  from tvm import te
label_desc: Use image node_id 1 for calling a global function with example usage: test_scan() without return types