'Generates a collection of bounding boxes to be used as anchors.
TODO: remove **params from argument list and make stride and offsets (for
multiple_grid_anchor_generator) constructor arguments.
Args:
feature_map_shape_list: list of (height, width) pairs in the format
[(height_0, width_0), (height_1, width_1), ...] that the generated
anchors must align with.  Pairs can be provided as 1-dimensional
integer tensors of length 2 or simply as tuples of integers.
**params: parameters for anchor generation op
Returns:
boxes: a BoxList holding a collection of N anchor boxes
Raises:
ValueError: if the number of feature map shapes does not match the length
of NumAnchorsPerLocation.'

def generate(self, feature_map_shape_list, **params):

    if (self.check_num_anchors and (len(feature_map_shape_list) != len(self.num_anchors_per_location()))):
        raise ValueError('Number    of    feature    maps    is    expected    to    equal    the    length    of    `num_anchors_per_location`.')
    with tf.name_scope(self.name_scope()):
        anchors = self._generate(feature_map_shape_list, **params)
        if self.check_num_anchors:
            with tf.control_dependencies([self._assert_correct_number_of_anchors(anchors, feature_map_shape_list)]):
                anchors.set(tf.identity(anchors.get()))
        return anchors
