code: def all_class_non_max_suppression(
      boxes,
      scores,
      max_output_boxes_per_class=-1,
      iou_threshold=-1.0,
      score_threshold=-1.0,
      output_format="onnx",
  ):
      """Non-maximum suppression operator for object detection, corresponding to ONNX
      NonMaxSuppression and TensorFlow combined_non_max_suppression.
      NMS is performed for each class separately.
  
      Parameters
      ----------
      boxes : relay.Expr
          3-D tensor with shape (batch_size, num_boxes, 4)
  
      scores: relay.Expr
          3-D tensor with shape (batch_size, num_classes, num_boxes)
  
      max_output_boxes_per_class : int or relay.Expr, optional
          The maxinum number of output selected boxes per class
  
      iou_threshold : float or relay.Expr, optionaIl
          IoU test threshold
  
      score_threshold : float or relay.Expr, optional
          Score threshold to filter out low score boxes early
  
      output_format : string, optional
          "onnx" or "tensorflow". Specify by which frontends the outputs are
          intented to be consumed.
  
      Returns
      -------
      out : relay.Tuple
          If `output_format` is "onnx", the output is a relay.Tuple of two tensors, the first is
          `indices` of size `(batch_size * num_class* num_boxes , 3)` and the second is a scalar
          tensor `num_total_detection` of shape `(1,)` representing the total number of selected
          boxes. The three values in `indices` encode batch, class, and box indices.
          Rows of `indices` are ordered such that selected boxes from batch 0, class 0 come first,
          in descending of scores, followed by boxes from batch 0, class 1 etc. Out of
          `batch_size * num_class* num_boxes` rows of indices,  only the first `num_total_detection`
          rows are valid.
  
          If `output_format` is "tensorflow", the output is a relay.Tuple of three tensors, the first
          is `indices` of size `(batch_size, num_class * num_boxes , 2)`, the second is `scores` of
          size `(batch_size, num_class * num_boxes)`, and the third is `num_total_detection` of size
          `(batch_size,)` representing the total number of selected boxes per batch. The two values
          in `indices` encode class and box indices. Of num_class * num_boxes boxes in `indices` at
          batch b, only the first `num_total_detection[b]` entries are valid. The second axis of
          `indices` and `scores` are sorted within each class by box scores, but not across classes.
          So the box indices and scores for the class 0 come first in a sorted order, followed by
          the class 1 etc.
      """
      if not isinstance(max_output_boxes_per_class, expr.Expr):
          max_output_boxes_per_class = expr.const(
              max_output_boxes_per_class, "int32"
          )
      if not isinstance(iou_threshold, expr.Expr):
          iou_threshold = expr.const(iou_threshold, "float32")
      if not isinstance(score_threshold, expr.Expr):
          score_threshold = expr.const(score_threshold, "float32")
  
      out = _make.all_class_non_max_suppression(
          boxes,
          scores,
          max_output_boxes_per_class,
          iou_threshold,
          score_threshold,
          output_format,
      )
  
      if output_format == "onnx":
          return expr.TupleWrapper(out, 2)
  
      return expr.TupleWrapper(out, 3)
  
imports: from tvm.relay import expr
  from .None import _make
label_desc: Use image node_id 3 for calling a global function with example usage: all_class_non_max_suppression(boxes, scores, max_output_boxes_per_class, iou_threshold, score_threshold, output_format) and returns: expr, expr