class_docstr: A callback to rewrite nms and restore batched nms.
class_docstr_tok: ["A","callback","to","rewrite","nms","and","restore","batched","nms","."]
docstr: Restore class-aware NMS using extracted class indices
docstr_tok: ["Restore","class-aware","NMS","using","extracted","class","indices"]
code: def convert_batched_nms(
      self, boxes, scores, idxs, iou_thres, num_boxes, indices
  ):
      """Restore class-aware NMS using extracted class indices"""
      scores = op.expand_dims(scores, axis=-1, num_newaxis=1)
      idxs = op.expand_dims(idxs, axis=-1, num_newaxis=1)
      idxs = op.cast(idxs, "float32")
      data = op.concatenate([idxs, scores, boxes], -1)
      data = op.expand_dims(data, 0, 1)
  
      top_k = max_out_size = -1
      out = op.vision.non_max_suppression(
          data=data,
          valid_count=num_boxes,
          indices=indices,
          max_output_size=max_out_size,
          iou_threshold=iou_thres,
          force_suppress=False,
          top_k=top_k,
          coord_start=2,
          score_index=1,
          id_index=0,
          return_indices=True,
          invalid_to_bottom=False,
      )
      return out.tuple_value
  
imports: from ..None import expr
  from ..None import op
  from ..dataflow_pattern import wildcard, is_constant, is_op, rewrite, is_tuple, is_tuple_get_item, is_if, DFPatternCallback
label_desc: Use image node_id 2 for calling the MulticlassNMSRewrite obj's underlying member method code with example usage: obj.convert_batched_nms(boxes, scores, idxs, iou_thres, num_boxes, indices) and returns: out