'Generates a collection of bounding boxes to be used as anchors.
Args:
feature_map_shape_list: list of pairs of convnet layer resolutions in the
format [(height_0, width_0)].  For example, setting
feature_map_shape_list=[(8, 8)] asks for anchors that correspond
to an 8x8 layer.  For this anchor generator, only lists of length 1 are
allowed.
Returns:
boxes: a BoxList holding a collection of N anchor boxes
Raises:
ValueError: if feature_map_shape_list, box_specs_list do not have the same
length.
ValueError: if feature_map_shape_list does not consist of pairs of
integers'

def _generate(self, feature_map_shape_list):

    if (not (isinstance(feature_map_shape_list, list) and (len(feature_map_shape_list) == 1))):
        raise ValueError('feature_map_shape_list    must    be    a    list    of    length    1.')
    if (not all([(isinstance(list_item, tuple) and (len(list_item) == 2)) for list_item in feature_map_shape_list])):
        raise ValueError('feature_map_shape_list    must    be    a    list    of    pairs.')
    (grid_height, grid_width) = feature_map_shape_list[0]
    (scales_grid, aspect_ratios_grid) = ops.meshgrid(self._scales, self._aspect_ratios)
    scales_grid = tf.reshape(scales_grid, [(-1)])
    aspect_ratios_grid = tf.reshape(aspect_ratios_grid, [(-1)])
    return tile_anchors(grid_height, grid_width, scales_grid, aspect_ratios_grid, self._base_anchor_size, self._anchor_stride, self._anchor_offset)
