code: def test_scan_group():
      m = te.size_var("m")
      n = te.size_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])
  
      s_update1 = te.compute(
          (m, n), lambda t, i: s_state[t - 1, i] + x[t, i]
      )
      s_update2 = te.compute((m, n), lambda t, i: s_update1[t, i] + 1)
      s_update3 = te.compute((m, n), lambda t, i: s_update2[t, i] + 1)
      res = tvm.te.scan(s_init, s_update3, s_state, inputs=x)
  
      s = te.create_schedule(res.op)
      assert s[s_update1].group is not None
      assert s[s_update2].group == s[s_update1].group
      # Assign within group, is valid
      s[s_update1].compute_at(s[s_update2], s_update2.op.axis[1])
      # create a new group, for [s_update2 and s_update1]
      g2 = s.create_group(outputs=s_update2, inputs=[s_state, x])
      assert g2.group is not None
      assert g2.group == s[s_update3].group
      assert s[s_update2].group == g2
      assert s[s_update1].group == g2
      g2.compute_at(s[s_update3], s_update3.op.axis[1])
      assert g2.attach_stage == s[s_update3]
      try:
          # compute outside group error.
          s[s_update2].compute_at(s[s_init], s_init.op.axis[0])
          assert False
      except tvm.error.TVMError:
          pass
  
imports: import tvm
  from tvm import te
label_desc: Use image node_id 1 for calling a global function with example usage: test_scan_group() without return types