code: def _get_sorted_indices(data, data_buf, score_index, score_shape):
      """Extract a 1D score tensor from the packed input and do argsort on it."""
      score_buf = tvm.tir.decl_buffer(
          score_shape, data.dtype, "score_buf", data_alignment=8
      )
      score_tensor = te.extern(
          [score_shape],
          [data],
          lambda ins, outs: _fetch_score_ir(
              ins[0],
              outs[0],
              score_index,
          ),
          dtype=[data.dtype],
          in_buffers=[data_buf],
          out_buffers=[score_buf],
          name="fetch_score",
          tag="fetch_score",
      )
      return _dispatch_sort(score_tensor)
  
imports: import tvm
  from tvm import te
  from tvm.contrib import nvcc
  from tvm.contrib.thrust import can_use_thrust, can_use_rocthrust
  from tvm.ir import register_intrin_lowering
  from tvm.tir import if_then_else
  from .sort import argsort, argsort_thrust
  from .scan import exclusive_scan
  from ..utils import ceil_div
  from ..math import cast
  from ..transform import reshape
  from ..vision.nms_util import calculate_overlap, binary_search, collect_selected_indices, collect_selected_indices_and_scores, run_all_class_nms
label_desc: Use image node_id 11 for calling a global function with example usage: _get_sorted_indices(data, data_buf, score_index, score_shape) and returns: _dispatch_sort