class_docstr: boxes (FS x FS x NA x 4): The anchor boxes.
  gt_labels (FS x FS x NA):
  gt_boxes (FS x FS x NA x 4): Groundtruth boxes corresponding to each anchor.
class_docstr_tok: ["boxes","(","FS","x","FS","x","NA","x","4",")",":","The","anchor","boxes",".","gt_labels","(","FS","x","FS","x","NA",")",":","gt_boxes","(","FS","x","FS","x","NA","x","4",")",":","Groundtruth","boxes","corresponding","to","each","anchor","."]
docstr: Slice anchors to the spatial size of this featuremap.
docstr_tok: ["Slice","anchors","to","the","spatial","size","of","this","featuremap","."]
code: def narrow_to(self, featuremap):
      """
      Slice anchors to the spatial size of this featuremap.
      """
      shape2d = tf.shape(featuremap)[2:]  # h,w
      slice3d = tf.concat([shape2d, [-1]], axis=0)
      slice4d = tf.concat([shape2d, [-1, -1]], axis=0)
      boxes = tf.slice(self.boxes, [0, 0, 0, 0], slice4d)
      gt_labels = tf.slice(self.gt_labels, [0, 0, 0], slice3d)
      gt_boxes = tf.slice(self.gt_boxes, [0, 0, 0, 0], slice4d)
      return RPNAnchors(boxes, gt_labels, gt_boxes)
  
file_path: tensorpack/examples/FasterRCNN/modeling/model_box.py
imports: import numpy
  import tensorflow
  from collections import namedtuple
  from tensorpack.tfutils.scope_utils import under_name_scope
  from config import config
label_desc: Use image node_id 3 for calling the RPNAnchors obj's underlying member method code with example usage: obj.narrow_to(featuremap) and returns: RPNAnchors