code: def _concatenate_outputs(
      out_bboxes,
      out_scores,
      out_class_ids,
      out_features,
      out_shape,
      coord_start,
      score_index,
      id_index,
  ):
      """Pack the results from NMS into a single 5D or 6D tensor."""
      batch_size = out_bboxes.shape[0]
      num_anchors = out_bboxes.shape[1]
      num_features = out_features.shape[2]
  
      def ir(out_bboxes, out_scores, out_class_ids, out):
          ib = tvm.tir.ir_builder.create()
  
          out_bboxes = ib.buffer_ptr(out_bboxes)
          out_scores = ib.buffer_ptr(out_scores)
          out_class_ids = ib.buffer_ptr(out_class_ids)
          out = ib.buffer_ptr(out)
  
          with ib.if_scope(num_anchors > 0):
              max_threads = int(
                  tvm.target.Target.current(
                      allow_none=False
                  ).max_num_threads
              )
              nthread_tx = max_threads
              nthread_bx = ceil_div(num_anchors, nthread_tx)
              tx = te.thread_axis("threadIdx.x")
              bx = te.thread_axis("blockIdx.x")
              by = te.thread_axis("blockIdx.y")
              ib.scope_attr(tx, "thread_extent", nthread_tx)
              ib.scope_attr(bx, "thread_extent", nthread_bx)
              ib.scope_attr(by, "thread_extent", batch_size)
  
              tid = bx * nthread_tx + tx
              i = by
  
              with ib.if_scope(tid < num_anchors):
                  with ib.for_range(0, 4, kind="unroll") as j:
                      out[i, tid, coord_start + j] = out_bboxes[
                          i, tid, j
                      ]
                  with ib.for_range(
                      0, num_features, kind="unroll"
                  ) as j:
                      out[i, tid, coord_start + 4 + j] = out_features[
                          i, tid, j
                      ]
                  out[i, tid, score_index] = out_scores[i, tid]
                  if id_index >= 0:
                      out[i, tid, id_index] = out_class_ids[i, tid]
  
          return ib.get()
  
      return te.extern(
          [out_shape],
          [out_bboxes, out_scores, out_class_ids],
          lambda ins, outs: ir(ins[0], ins[1], ins[2], outs[0]),
          dtype=["float32"],
          name="nms_output_concat",
          tag="nms_output_concat",
      )
  
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 13 for calling a global function with example usage: _concatenate_outputs(out_bboxes, out_scores, out_class_ids, out_features, out_shape, coord_start, score_index, id_index) and returns: te, ib