code: def _check_call(self, x, img_size, scales):
      _, _, H, W = x.shape
      with chainer.using_config("train", self.train):
          rpn_locs, rpn_scores, rois, roi_indices, anchor = self.link(
              chainer.Variable(x), img_size, scales
          )
      self.assertIsInstance(rpn_locs, chainer.Variable)
      self.assertIsInstance(rpn_locs.array, type(x))
      self.assertIsInstance(rpn_scores, chainer.Variable)
      self.assertIsInstance(rpn_scores.array, type(x))
  
      A = len(self.ratios) * len(self.anchor_scales)
      self.assertEqual(rpn_locs.shape, (self.B, H * W * A, 4))
      self.assertEqual(rpn_scores.shape, (self.B, H * W * A, 2))
  
      if self.train:
          roi_size = self.proposal_creator_params["n_train_post_nms"]
      else:
          roi_size = self.proposal_creator_params["n_test_post_nms"]
  
      self.assertIsInstance(rois, type(x))
      self.assertIsInstance(roi_indices, type(x))
      self.assertLessEqual(rois.shape[0], self.B * roi_size)
      self.assertLessEqual(roi_indices.shape[0], self.B * roi_size)
  
      # Depending randomly generated bounding boxes, this is not true.
      if roi_indices.shape[0] == self.B * roi_size:
          for i in range(self.B):
              s = slice(i * roi_size, (i + 1) * roi_size)
              np.testing.assert_equal(
                  cuda.to_cpu(roi_indices[s]),
                  i * np.ones((roi_size,), dtype=np.int32),
              )
  
      self.assertIsInstance(anchor, type(x))
      self.assertEqual(anchor.shape, (A * H * W, 4))
  
file_path: chainercv/tests/links_tests/model_tests/faster_rcnn_tests/test_region_proposal_network.py
imports: import numpy
  import unittest
  import chainer
  from chainer.backends import cuda
  from chainer import testing
  from chainer.testing import attr
  from chainercv.links.model.faster_rcnn import RegionProposalNetwork
label_desc: Use image node_id 2 for calling the TestRegionProposalNetwork obj's underlying member method code with example usage: obj._check_call(x, img_size, scales) without return types