class_docstr: Bounding box head network of Feature Pyramid Networks.
  
  Args:
      n_class (int): The number of classes including background.
      scales (tuple of floats): The scales of feature maps.
class_docstr_tok: ["Bounding","box","head","network","of","Feature","Pyramid","Networks",".","Args",":","n_class","(","int",")",":","The","number","of","classes","including","background",".","scales","(","tuple","of","floats",")",":","The","scales","of","feature","maps","."]
docstr: Calculates RoIs.
  
  Args:
      hs (iterable of array): An iterable of feature maps.
      rois (list of arrays): A list of arrays of shape: math: `(R_l, 4)`,
          where: math: `R_l` is the number of RoIs in the: math: `l`- th
          feature map.
      roi_indices (list of arrays): A list of arrays of
          shape :math:`(R_l,)`.
  
  Returns:
      tuple of two arrays:
      :obj:`locs` and :obj:`confs`.
  
      * **locs**: An arrays whose shape is                 :math:`(R, n\_class, 4)`, where :math:`R` is the total number                 of RoIs in the batch.
      * **confs**: A list of array whose shape is :math:`(R, n\_class)`.
docstr_tok: ["Calculates","RoIs",".","Args",":","hs","(","iterable","of","array",")",":","An","iterable","of","feature","maps",".","rois","(","list","of","arrays",")",":","A","list","of","arrays","of","shape",":","math",":","`","(","R_l",",","4",")","`",",","where",":","math",":","`","R_l","`","is","the","number","of","RoIs","in","the",":","math",":","`","l","`","-","th","feature","map",".","roi_indices","(","list","of","arrays",")",":","A","list","of","arrays","of","shape",":","math",":","`","(","R_l",",",")","`",".","Returns",":","tuple","of","two","arrays",":",":","obj",":","`","locs","`","and",":","obj",":","`","confs","`",".","*","*","*","locs","*","*",":","An","arrays","whose","shape","is",":","math",":","`","(","R",",","n\\_class",",","4",")","`",",","where",":","math",":","`","R","`","is","the","total","number","of","RoIs","in","the","batch",".","*","*","*","confs","*","*",":","A","list","of","array","whose","shape","is",":","math",":","`","(","R",",","n\\_class",")","`","."]
code: def forward(self, hs, rois, roi_indices):
      """Calculates RoIs.
  
          Args:
              hs (iterable of array): An iterable of feature maps.
              rois (list of arrays): A list of arrays of shape: math: `(R_l, 4)`,
                  where: math: `R_l` is the number of RoIs in the: math: `l`- th
                  feature map.
              roi_indices (list of arrays): A list of arrays of
                  shape :math:`(R_l,)`.
  
          Returns:
              tuple of two arrays:
              :obj:`locs` and :obj:`confs`.
  
              * **locs**: An arrays whose shape is \
                  :math:`(R, n\_class, 4)`, where :math:`R` is the total number \
                  of RoIs in the batch.
              * **confs**: A list of array whose shape is :math:`(R, n\_class)`.
          """
  
      hs_ = []
      for l, h in enumerate(hs):
          if len(rois[l]) == 0:
              continue
          h = F.roi_average_align_2d(
              h,
              rois[l],
              roi_indices[l],
              self._roi_size,
              self._scales[l],
              self._roi_sample_ratio,
          )
          hs_.append(h)
      hs = hs_
  
      if len(hs) == 0:
          locs = chainer.Variable(
              self.xp.empty((0, self._n_class, 4), dtype=np.float32)
          )
          confs = chainer.Variable(
              self.xp.empty((0, self._n_class), dtype=np.float32)
          )
          return locs, confs
  
      h = F.concat(hs, axis=0)
      h = F.reshape(h, (h.shape[0], -1))
      h = F.relu(self.fc1(h))
      h = F.relu(self.fc2(h))
  
      locs = self.loc(h)
      locs = F.reshape(locs, (locs.shape[0], -1, 4))
      confs = self.conf(h)
      return locs, confs
  
imports: from __future__ import division
  import numpy
  import chainer
  from chainer.backends import cuda
  import chainer.functions
  from chainer import initializers
  import chainer.links
  from chainercv.links.model.fpn.misc import argsort
  from chainercv.links.model.fpn.misc import choice
  from chainercv.links.model.fpn.misc import exp_clip
  from chainercv.links.model.fpn.misc import smooth_l1
  from chainercv import utils
label_desc: Use image node_id 2 for calling the BboxHead obj's underlying member method code with example usage: obj.forward(hs, rois, roi_indices) and returns: locs,  confs, locs,  confs