code: def _check_bbox_head_loss_post(self, xp):
      locs = chainer.Variable(_random_array(xp, (20, 81, 4)))
      confs = chainer.Variable(_random_array(xp, (20, 81)))
      roi_indices = [
          xp.random.randint(0, 2, size=5).astype(np.int32),
          xp.random.randint(0, 2, size=7).astype(np.int32),
          xp.random.randint(0, 2, size=8).astype(np.int32),
      ]
      gt_locs = [
          _random_array(xp, (5, 4)),
          _random_array(xp, (7, 4)),
          _random_array(xp, (8, 4)),
      ]
      gt_labels = [
          xp.random.randint(0, 80, size=5).astype(np.int32),
          xp.random.randint(0, 80, size=7).astype(np.int32),
          xp.random.randint(0, 80, size=8).astype(np.int32),
      ]
  
      loc_loss, conf_loss = bbox_head_loss_post(
          locs, confs, roi_indices, gt_locs, gt_labels, 2
      )
  
      self.assertIsInstance(loc_loss, chainer.Variable)
      self.assertIsInstance(loc_loss.array, xp.ndarray)
      self.assertEqual(loc_loss.shape, ())
  
      self.assertIsInstance(conf_loss, chainer.Variable)
      self.assertIsInstance(conf_loss.array, xp.ndarray)
      self.assertEqual(conf_loss.shape, ())
  
imports: from __future__ import division
  import numpy
  import unittest
  import chainer
  from chainer import testing
  from chainer.testing import attr
  from chainercv.links.model.fpn import bbox_head_loss_post
  from chainercv.links.model.fpn import bbox_head_loss_pre
  from chainercv.links.model.fpn import BboxHead
label_desc: Use image node_id 4 for calling the TestBboxLoss obj's underlying member method code with example usage: obj._check_bbox_head_loss_post(xp) without return types