def anchor_generator(input, anchor_sizes=None, aspect_ratios=None, variance=[0.1, 0.1, 0.2, 0.2], stride=None, offset=0.5, name=None):
    "\n\t:alias_main: paddle.nn.functional.anchor_generator\n\t:alias: paddle.nn.functional.anchor_generator,paddle.nn.functional.vision.anchor_generator\n\t:old_api: paddle.fluid.layers.anchor_generator\n\n    **Anchor generator operator**\n\n    Generate anchors for Faster RCNN algorithm.\n    Each position of the input produce N anchors, N =\n    size(anchor_sizes) * size(aspect_ratios). The order of generated anchors\n    is firstly aspect_ratios loop then anchor_sizes loop.\n\n    Args:\n       input(Variable): 4-D Tensor with shape [N,C,H,W]. The input feature map.\n       anchor_sizes(float32|list|tuple, optional): The anchor sizes of generated\n          anchors, given in absolute pixels e.g. [64., 128., 256., 512.].\n          For instance, the anchor size of 64 means the area of this anchor \n          equals to 64**2. None by default.\n       aspect_ratios(float32|list|tuple, optional): The height / width ratios \n           of generated anchors, e.g. [0.5, 1.0, 2.0]. None by default.\n       variance(list|tuple, optional): The variances to be used in box \n           regression deltas. The data type is float32, [0.1, 0.1, 0.2, 0.2] by \n           default.\n       stride(list|tuple, optional): The anchors stride across width and height.\n           The data type is float32. e.g. [16.0, 16.0]. None by default.\n       offset(float32, optional): Prior boxes center offset. 0.5 by default.\n       name(str, optional): For detailed information, please refer \n           to :ref:`api_guide_Name`. Usually name is no need to set and None \n           by default. \n\n    Returns:\n        Tuple:\n\n        Anchors(Variable): The output anchors with a layout of [H, W, num_anchors, 4].\n        H is the height of input, W is the width of input,\n        num_anchors is the box count of each position. \n        Each anchor is in (xmin, ymin, xmax, ymax) format an unnormalized.\n \n        Variances(Variable): The expanded variances of anchors\n        with a layout of [H, W, num_priors, 4].\n        H is the height of input, W is the width of input\n        num_anchors is the box count of each position.\n        Each variance is in (xcenter, ycenter, w, h) format.\n\n\n    Examples:\n\n        .. code-block:: python\n\n            import paddle.fluid as fluid\n            conv1 = fluid.data(name='conv1', shape=[None, 48, 16, 16], dtype='float32')\n            anchor, var = fluid.layers.anchor_generator(\n                input=conv1,\n                anchor_sizes=[64, 128, 256, 512],\n                aspect_ratios=[0.5, 1.0, 2.0],\n                variance=[0.1, 0.1, 0.2, 0.2],\n                stride=[16.0, 16.0],\n                offset=0.5)\n    "
    helper = LayerHelper('anchor_generator', **locals())
    dtype = helper.input_dtype()

    def _is_list_or_tuple_(data):
        return (isinstance(data, list) or isinstance(data, tuple))
    if (not _is_list_or_tuple_(anchor_sizes)):
        anchor_sizes = [anchor_sizes]
    if (not _is_list_or_tuple_(aspect_ratios)):
        aspect_ratios = [aspect_ratios]
    if (not (_is_list_or_tuple_(stride) and (len(stride) == 2))):
        raise ValueError('stride should be a list or tuple ', 'with length 2, (stride_width, stride_height).')
    anchor_sizes = list(map(float, anchor_sizes))
    aspect_ratios = list(map(float, aspect_ratios))
    stride = list(map(float, stride))
    attrs = {'anchor_sizes': anchor_sizes, 'aspect_ratios': aspect_ratios, 'variances': variance, 'stride': stride, 'offset': offset}
    anchor = helper.create_variable_for_type_inference(dtype)
    var = helper.create_variable_for_type_inference(dtype)
    helper.append_op(type='anchor_generator', inputs={'Input': input}, outputs={'Anchors': anchor, 'Variances': var}, attrs=attrs)
    anchor.stop_gradient = True
    var.stop_gradient = True
    return (anchor, var)
:alias_main: paddle.nn.functional.anchor_generator
    :alias: paddle.nn.functional.anchor_generator,paddle.nn.functional.vision.anchor_generator
    :old_api: paddle.fluid.layers.anchor_generator

**Anchor generator operator**

Generate anchors for Faster RCNN algorithm.
Each position of the input produce N anchors, N =
size(anchor_sizes) * size(aspect_ratios). The order of generated anchors
is firstly aspect_ratios loop then anchor_sizes loop.

Args:
   input(Variable): 4-D Tensor with shape [N,C,H,W]. The input feature map.
   anchor_sizes(float32|list|tuple, optional): The anchor sizes of generated
      anchors, given in absolute pixels e.g. [64., 128., 256., 512.].
      For instance, the anchor size of 64 means the area of this anchor 
      equals to 64**2. None by default.
   aspect_ratios(float32|list|tuple, optional): The height / width ratios 
       of generated anchors, e.g. [0.5, 1.0, 2.0]. None by default.
   variance(list|tuple, optional): The variances to be used in box 
       regression deltas. The data type is float32, [0.1, 0.1, 0.2, 0.2] by 
       default.
   stride(list|tuple, optional): The anchors stride across width and height.
       The data type is float32. e.g. [16.0, 16.0]. None by default.
   offset(float32, optional): Prior boxes center offset. 0.5 by default.
   name(str, optional): For detailed information, please refer 
       to :ref:`api_guide_Name`. Usually name is no need to set and None 
       by default. 

Returns:
    Tuple:

    Anchors(Variable): The output anchors with a layout of [H, W, num_anchors, 4].
    H is the height of input, W is the width of input,
    num_anchors is the box count of each position. 
    Each anchor is in (xmin, ymin, xmax, ymax) format an unnormalized.

    Variances(Variable): The expanded variances of anchors
    with a layout of [H, W, num_priors, 4].
    H is the height of input, W is the width of input
    num_anchors is the box count of each position.
    Each variance is in (xcenter, ycenter, w, h) format.


Examples:

    .. code-block:: python

        import paddle.fluid as fluid
        conv1 = fluid.data(name='conv1', shape=[None, 48, 16, 16], dtype='float32')
        anchor, var = fluid.layers.anchor_generator(
            input=conv1,
            anchor_sizes=[64, 128, 256, 512],
            aspect_ratios=[0.5, 1.0, 2.0],
            variance=[0.1, 0.1, 0.2, 0.2],
            stride=[16.0, 16.0],
            offset=0.5)
def anchor_generator(input, anchor_sizes=None, aspect_ratios=None, variance=[0.1, 0.1, 0.2, 0.2], stride=None, offset=0.5, name=None):
    "\n\t:alias_main: paddle.nn.functional.anchor_generator\n\t:alias: paddle.nn.functional.anchor_generator,paddle.nn.functional.vision.anchor_generator\n\t:old_api: paddle.fluid.layers.anchor_generator\n\n    **Anchor generator operator**\n\n    Generate anchors for Faster RCNN algorithm.\n    Each position of the input produce N anchors, N =\n    size(anchor_sizes) * size(aspect_ratios). The order of generated anchors\n    is firstly aspect_ratios loop then anchor_sizes loop.\n\n    Args:\n       input(Variable): 4-D Tensor with shape [N,C,H,W]. The input feature map.\n       anchor_sizes(float32|list|tuple, optional): The anchor sizes of generated\n          anchors, given in absolute pixels e.g. [64., 128., 256., 512.].\n          For instance, the anchor size of 64 means the area of this anchor \n          equals to 64**2. None by default.\n       aspect_ratios(float32|list|tuple, optional): The height / width ratios \n           of generated anchors, e.g. [0.5, 1.0, 2.0]. None by default.\n       variance(list|tuple, optional): The variances to be used in box \n           regression deltas. The data type is float32, [0.1, 0.1, 0.2, 0.2] by \n           default.\n       stride(list|tuple, optional): The anchors stride across width and height.\n           The data type is float32. e.g. [16.0, 16.0]. None by default.\n       offset(float32, optional): Prior boxes center offset. 0.5 by default.\n       name(str, optional): For detailed information, please refer \n           to :ref:`api_guide_Name`. Usually name is no need to set and None \n           by default. \n\n    Returns:\n        Tuple:\n\n        Anchors(Variable): The output anchors with a layout of [H, W, num_anchors, 4].\n        H is the height of input, W is the width of input,\n        num_anchors is the box count of each position. \n        Each anchor is in (xmin, ymin, xmax, ymax) format an unnormalized.\n \n        Variances(Variable): The expanded variances of anchors\n        with a layout of [H, W, num_priors, 4].\n        H is the height of input, W is the width of input\n        num_anchors is the box count of each position.\n        Each variance is in (xcenter, ycenter, w, h) format.\n\n\n    Examples:\n\n        .. code-block:: python\n\n            import paddle.fluid as fluid\n            conv1 = fluid.data(name='conv1', shape=[None, 48, 16, 16], dtype='float32')\n            anchor, var = fluid.layers.anchor_generator(\n                input=conv1,\n                anchor_sizes=[64, 128, 256, 512],\n                aspect_ratios=[0.5, 1.0, 2.0],\n                variance=[0.1, 0.1, 0.2, 0.2],\n                stride=[16.0, 16.0],\n                offset=0.5)\n    "
    helper = LayerHelper('anchor_generator', **locals())
    dtype = helper.input_dtype()

    def _is_list_or_tuple_(data):
        return (isinstance(data, list) or isinstance(data, tuple))
    if (not _is_list_or_tuple_(anchor_sizes)):
        anchor_sizes = [anchor_sizes]
    if (not _is_list_or_tuple_(aspect_ratios)):
        aspect_ratios = [aspect_ratios]
    if (not (_is_list_or_tuple_(stride) and (len(stride) == 2))):
        raise ValueError('stride should be a list or tuple ', 'with length 2, (stride_width, stride_height).')
    anchor_sizes = list(map(float, anchor_sizes))
    aspect_ratios = list(map(float, aspect_ratios))
    stride = list(map(float, stride))
    attrs = {'anchor_sizes': anchor_sizes, 'aspect_ratios': aspect_ratios, 'variances': variance, 'stride': stride, 'offset': offset}
    anchor = helper.create_variable_for_type_inference(dtype)
    var = helper.create_variable_for_type_inference(dtype)
    helper.append_op(type='anchor_generator', inputs={'Input': input}, outputs={'Anchors': anchor, 'Variances': var}, attrs=attrs)
    anchor.stop_gradient = True
    var.stop_gradient = True
    return (anchor, var)