code: def test_roi_align(self):
      b, c, h, w = 2, 12, 20, 20
      inputs_np = np.random.rand(b, c, h, w).astype("float32")
      rois_num = [4, 6]
      output_size = (7, 7)
      rois_np = make_rois(h, w, rois_num, output_size)
      rois_num_np = np.array(rois_num).astype("int32")
      with self.static_graph():
          inputs = paddle.static.data(
              name="inputs", shape=[b, c, h, w], dtype="float32"
          )
          rois = paddle.static.data(
              name="rois", shape=[10, 4], dtype="float32"
          )
          rois_num = paddle.static.data(
              name="rois_num", shape=[None], dtype="int32"
          )
  
          output = paddle.vision.ops.roi_align(
              x=inputs,
              boxes=rois,
              boxes_num=rois_num,
              output_size=output_size,
          )
          (output_np,) = self.get_static_graph_result(
              feed={
                  "inputs": inputs_np,
                  "rois": rois_np,
                  "rois_num": rois_num_np,
              },
              fetch_list=output,
              with_lod=False,
          )
  
      with self.dynamic_graph():
          inputs_dy = paddle.to_tensor(inputs_np)
          rois_dy = paddle.to_tensor(rois_np)
          rois_num_dy = paddle.to_tensor(rois_num_np)
  
          output_dy = paddle.vision.ops.roi_align(
              x=inputs_dy,
              boxes=rois_dy,
              boxes_num=rois_num_dy,
              output_size=output_size,
          )
          output_dy_np = output_dy.numpy()
  
      self.assertTrue(np.array_equal(output_np, output_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 TestROIAlign obj's underlying member method code with example usage: obj.test_roi_align() without return types