code: def test_forward_cpu_gpu_equal(self):
      # cpu
      x_cpu = chainer.Variable(self.x)
      rois_cpu = chainer.Variable(self.rois)
      roi_indices_cpu = chainer.Variable(self.roi_indices)
      y_cpu = functions.roi_average_pooling_2d(
          x_cpu,
          rois_cpu,
          roi_indices_cpu,
          outsize=self.outsize,
          spatial_scale=self.spatial_scale,
      )
  
      # gpu
      x_gpu = chainer.Variable(cuda.to_gpu(self.x))
      rois_gpu = chainer.Variable(cuda.to_gpu(self.rois))
      roi_indices_gpu = chainer.Variable(cuda.to_gpu(self.roi_indices))
      y_gpu = functions.roi_average_pooling_2d(
          x_gpu,
          rois_gpu,
          roi_indices_gpu,
          outsize=self.outsize,
          spatial_scale=self.spatial_scale,
      )
      testing.assert_allclose(y_cpu.data, cuda.to_cpu(y_gpu.data))
  
imports: import unittest
  import numpy
  import chainer
  from chainer.backends import cuda
  from chainer import functions
  from chainer import gradient_check
  from chainer import testing
  from chainer.testing import attr
  from chainer.utils import collections_abc
  from chainer_tests.functions_tests.pooling_tests import pooling_nd_helper
label_desc: Use image node_id 5 for calling the TestROIAveragePooling2D obj's underlying member method code with example usage: obj.test_forward_cpu_gpu_equal() without return types