code: def get_valid_counts(
      data: T.handle,
      valid_count: T.handle,
      out: T.handle,
      out_indices: T.handle,
      score_threshold: T.float32,
      id_index: T.int32,
      score_index: T.int32,
  ) -> None:
      data_buf = T.match_buffer(data, (1, 2500, 6), "float32")
      valid_count_buf = T.match_buffer(valid_count, (1,), "int32")
      out_buf = T.match_buffer(out, (1, 2500, 6), "float32")
      out_indices_buf = T.match_buffer(out_indices, (1, 2500), "int32")
  
      with T.block("init"):
          vi = T.axis.S(1, 0)
          valid_count_buf[vi] = T.int32(0)
          for j in range(2500):
              with T.block("update"):
                  vj = T.axis.S(2500, j)
                  T.reads([data_buf[vi, vj, 6]])
                  T.writes(
                      [
                          valid_count_buf[vi],
                          out_indices_buf[vi, vj],
                          out_buf[vi, vj, 6],
                      ]
                  )
                  if (
                      data_buf[vi, vj, score_index] > score_threshold
                  ) and (
                      (id_index < 0)
                      or (data_buf[vi, vj, id_index] >= T.float32(0))
                  ):
                      for k in T.serial(0, 6):
                          out_buf[
                              vi, valid_count_buf[vi], k
                          ] = data_buf[vi, vj, k]
                      out_indices_buf[vi, valid_count_buf[vi]] = vj
                      valid_count_buf[vi] = valid_count_buf[vi] + 1
                  if vj >= valid_count_buf[vi]:
                      for k in T.serial(0, 6):
                          out_buf[vi, vj, k] = T.float32(-1)
                      out_indices_buf[vi, vj] = T.int32(-1)
  
file_path: tvm/tests/python/tvmscript/test_tvmscript_ops.py
imports: import numpy
  import tvm
  import tvm.testing
  from tvm.script import tir
label_desc: Use image node_id 1 for calling a global function with example usage: get_valid_counts(data, valid_count, out, out_indices, score_threshold, id_index, score_index) without return types