code: def test_multiclass_nms(self):
      boxes_np = np.random.rand(10, 81, 4).astype("float32")
      scores_np = np.random.rand(10, 81).astype("float32")
      rois_num_np = np.array([2, 8]).astype("int32")
      with self.static_graph():
          boxes = paddle.static.data(
              name="bboxes",
              shape=[None, 81, 4],
              dtype="float32",
              lod_level=1,
          )
          scores = paddle.static.data(
              name="scores",
              shape=[None, 81],
              dtype="float32",
              lod_level=1,
          )
          rois_num = paddle.static.data(
              name="rois_num", shape=[None], dtype="int32"
          )
  
          output = ops.multiclass_nms(
              bboxes=boxes,
              scores=scores,
              background_label=0,
              score_threshold=0.5,
              nms_top_k=400,
              nms_threshold=0.3,
              keep_top_k=200,
              normalized=False,
              return_index=True,
              rois_num=rois_num,
          )
          (
              out_np,
              index_np,
              nms_rois_num_np,
          ) = self.get_static_graph_result(
              feed={
                  "bboxes": boxes_np,
                  "scores": scores_np,
                  "rois_num": rois_num_np,
              },
              fetch_list=output,
              with_lod=True,
          )
          out_np = np.array(out_np)
          index_np = np.array(index_np)
          nms_rois_num_np = np.array(nms_rois_num_np)
  
      with self.dynamic_graph():
          boxes_dy = paddle.to_tensor(boxes_np)
          scores_dy = paddle.to_tensor(scores_np)
          rois_num_dy = paddle.to_tensor(rois_num_np)
  
          out_dy, index_dy, nms_rois_num_dy = ops.multiclass_nms(
              bboxes=boxes_dy,
              scores=scores_dy,
              background_label=0,
              score_threshold=0.5,
              nms_top_k=400,
              nms_threshold=0.3,
              keep_top_k=200,
              normalized=False,
              return_index=True,
              rois_num=rois_num_dy,
          )
          out_dy_np = out_dy.numpy()
          index_dy_np = index_dy.numpy()
          nms_rois_num_dy_np = nms_rois_num_dy.numpy()
  
      self.assertTrue(np.array_equal(out_np, out_dy_np))
      self.assertTrue(np.array_equal(index_np, index_dy_np))
      self.assertTrue(
          np.array_equal(nms_rois_num_np, nms_rois_num_dy_np)
      )
  
imports: from __future__ import print_function
  import os, sys
  import unittest
  import numpy
  import paddle
  import ppdet.modeling.ops
  from ppdet.modeling.tests.test_base import LayerTest
label_desc: Use image node_id 1 for calling the TestMulticlassNms obj's underlying member method code with example usage: obj.test_multiclass_nms() without return types