code: def argsort_ir(data_buf, out_index_buf):
      """Batched odd-even transposition sort.
  
      Parameters
      ----------
      data_buf : tvm.te.schedule.Buffer
          2-D with shape [batch, num_bbox]
  
      out_index_buf : tvm.te.schedule.Buffer
          2-D with shape [batch, num_bbox]. Indices of data in sorted order.
  
      Returns
      -------
      stmt : Stmt
          The result IR statement.
      """
      batch, num_bbox = get_const_tuple(data_buf.shape)
      ib = tvm.tir.ir_builder.create()
      p_data = ib.buffer_ptr(data_buf)
      index_out = ib.buffer_ptr(out_index_buf)
      temp_data = ib.allocate(
          "float32", (1,), name="temp_data", scope="local"
      )
      temp_index = ib.allocate(
          "int32", (1,), name="temp_index", scope="local"
      )
      idxm = tvm.tir.indexmod
      with ib.for_range(0, batch, kind="unroll") as b:
          start = b * num_bbox
          for i in range(2):
              with ib.for_range(0, (num_bbox + 1) // 2) as tid:
                  bbox_id = tid * 2 + i
                  with ib.if_scope(bbox_id < num_bbox):
                      index_out[start + bbox_id] = bbox_id
          with ib.for_range(0, num_bbox) as k:
              with ib.for_range(0, (num_bbox + 1) // 2) as tid:
                  offset = start + 2 * tid + idxm(k, 2)
                  with ib.if_scope(
                      tvm.tir.all(
                          offset + 1 < num_bbox,
                          p_data[offset] < p_data[offset + 1],
                      )
                  ):
                      temp_data[0] = p_data[offset]
                      p_data[offset] = p_data[offset + 1]
                      p_data[offset + 1] = temp_data[0]
                      temp_index[0] = index_out[offset]
                      index_out[offset] = index_out[offset + 1]
                      index_out[offset + 1] = temp_index[0]
      return ib.get()
  
file_path: tvm/python/tvm/topi/vision/rcnn/proposal.py
imports: import math
  import tvm
  from tvm import te
  from ...utils import get_const_tuple, get_const_int
  from ...sort import argsort
label_desc: Use image node_id 5 for calling a global function with example usage: argsort_ir(data_buf, out_index_buf) and returns: ib