code: def _check_get_valid_counts_with_numpy(
      f, dshape, score_threshold, id_index, score_index
  ):
      dtype = "float32"
      ctx = tvm.cpu()
      batch_size, num_anchor, elem_length = dshape
      np_data = np.random.uniform(low=-2, high=2, size=dshape).astype(
          dtype
      )
      np_out1 = np.zeros(shape=(batch_size,), dtype="int32")
      np_out2 = np.zeros(shape=dshape).astype(dtype)
      np_out3 = np.zeros(shape=(batch_size, num_anchor), dtype="int32")
      for i in range(batch_size):
          np_out1[i] = 0
          inter_idx = 0
          for j in range(num_anchor):
              score = np_data[i, j, score_index]
              if score > score_threshold and (
                  id_index < 0 or np_data[i, j, id_index] >= 0
              ):
                  for k in range(elem_length):
                      np_out2[i, inter_idx, k] = np_data[i, j, k]
                  np_out1[i] += 1
                  np_out3[i, inter_idx] = j
                  inter_idx += 1
              if j >= np_out1[i]:
                  for k in range(elem_length):
                      np_out2[i, j, k] = -1.0
                  np_out3[i, j] = -1
  
      in_data = tvm.nd.array(np_data, ctx)
      out1 = tvm.nd.array(np_out1, ctx)
      out2 = tvm.nd.array(np_out2, ctx)
      out3 = tvm.nd.array(np_out3, ctx)
      f(
          in_data,
          out1,
          out2,
          out3,
          score_threshold,
          id_index,
          score_index,
      )
      tvm.testing.assert_allclose(out1.numpy(), np_out1, rtol=1e-5)
      tvm.testing.assert_allclose(out2.numpy(), np_out2, rtol=1e-5)
      tvm.testing.assert_allclose(out3.numpy(), np_out3, rtol=1e-5)
      print("test get_valid_counts end")
  
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 2 for calling a global function with example usage: _check_get_valid_counts_with_numpy(f, dshape, score_threshold, id_index, score_index) without return types