import tensorflow as tf

            raise ValueError('anchors must be an BoxList')
        if not isinstance(groundtruth_boxes, box_list.BoxList):
            raise ValueError('groundtruth_boxes must be an BoxList')

        if groundtruth_labels is None:
            groundtruth_labels = tf.ones(tf.expand_dims(groundtruth_boxes.num_boxes(),
                                                        0))
            groundtruth_labels = tf.expand_dims(groundtruth_labels, -1)
        shape_assert = tf.assert_equal(tf.shape(groundtruth_labels)[1:],
                                       tf.shape(self._unmatched_cls_target))

        with tf.control_dependencies([shape_assert]):
            match_quality_matrix = self._similarity_calc.compare(groundtruth_boxes,
                                                                 anchors)
            match = self._matcher.match(match_quality_matrix, **params)
            reg_targets = self._create_regression_targets(anchors,
                                                          groundtruth_boxes,
                                                          match)
