def prior_box(input, image, min_sizes, max_sizes=None, aspect_ratios=[1.0], variance=[0.1, 0.1, 0.2, 0.2], flip=False, clip=False, steps=[0.0, 0.0], offset=0.5, name=None, min_max_aspect_ratios_order=False):
    '\n\t:alias_main: paddle.nn.functional.prior_box\n\t:alias: paddle.nn.functional.prior_box,paddle.nn.functional.vision.prior_box\n\t:old_api: paddle.fluid.layers.prior_box\n\n    This op generates prior boxes for SSD(Single Shot MultiBox Detector) algorithm.\n    Each position of the input produce N prior boxes, N is determined by\n    the count of min_sizes, max_sizes and aspect_ratios, The size of the\n    box is in range(min_size, max_size) interval, which is generated in\n    sequence according to the aspect_ratios.\n\n    Parameters:\n       input(Variable): 4-D tensor(NCHW), the data type should be float32 or float64.\n       image(Variable): 4-D tensor(NCHW), the input image data of PriorBoxOp,\n            the data type should be float32 or float64.\n       min_sizes(list|tuple|float): the min sizes of generated prior boxes.\n       max_sizes(list|tuple|None): the max sizes of generated prior boxes.\n            Default: None.\n       aspect_ratios(list|tuple|float): the aspect ratios of generated\n            prior boxes. Default: [1.].\n       variance(list|tuple): the variances to be encoded in prior boxes.\n            Default:[0.1, 0.1, 0.2, 0.2].\n       flip(bool): Whether to flip aspect ratios. Default:False.\n       clip(bool): Whether to clip out-of-boundary boxes. Default: False.\n       step(list|tuple): Prior boxes step across width and height, If\n            step[0] equals to 0.0 or step[1] equals to 0.0, the prior boxes step across\n            height or weight of the input will be automatically calculated.\n            Default: [0., 0.]\n       offset(float): Prior boxes center offset. Default: 0.5\n       min_max_aspect_ratios_order(bool): If set True, the output prior box is\n            in order of [min, max, aspect_ratios], which is consistent with\n            Caffe. Please note, this order affects the weights order of\n            convolution layer followed by and does not affect the final\n            detection results. Default: False.\n       name(str, optional): The default value is None.  Normally there is no need for user to set this property.  For more information, please refer to :ref:`api_guide_Name`\n\n    Returns:\n        Tuple: A tuple with two Variable (boxes, variances)\n\n        boxes(Variable): the output prior boxes of PriorBox.\n\t4-D tensor, the layout is [H, W, num_priors, 4].\n        H is the height of input, W is the width of input,\n        num_priors is the total box count of each position of input.\n\n        variances(Variable): the expanded variances of PriorBox.\n    \t4-D tensor, the layput is [H, W, num_priors, 4].\n        H is the height of input, W is the width of input\n        num_priors is the total box count of each position of input\n\n    Examples:\n        .. code-block:: python\n\n\t    #declarative mode\n\t    import paddle.fluid as fluid\n\t    import numpy as np\n\t    input = fluid.data(name="input", shape=[None,3,6,9])\n\t    image = fluid.data(name="image", shape=[None,3,9,12])\n\t    box, var = fluid.layers.prior_box(\n                 input=input,\n                 image=image,\n\t\t min_sizes=[100.],\n                 clip=True,\n                 flip=True)\n\n\t    place = fluid.CPUPlace()\n\t    exe = fluid.Executor(place)\n\t    exe.run(fluid.default_startup_program())\n \n\t    # prepare a batch of data\n\t    input_data = np.random.rand(1,3,6,9).astype("float32")\n\t    image_data = np.random.rand(1,3,9,12).astype("float32")\n \n\t    box_out, var_out = exe.run(fluid.default_main_program(),\n                feed={"input":input_data,"image":image_data},\n                fetch_list=[box,var],\n                return_numpy=True)\n \n\t    # print(box_out.shape)\n\t    # (6, 9, 1, 4)\n\t    # print(var_out.shape)\n\t    # (6, 9, 1, 4)\n\n\t    # imperative mode\n\t    import paddle.fluid.dygraph as dg\n\n\t    with dg.guard(place) as g:\n    \t\tinput = dg.to_variable(input_data)\n    \t\timage = dg.to_variable(image_data)\n    \t\tbox, var = fluid.layers.prior_box(\n\t\t    input=input,\n\t\t    image=image,\n\t\t    min_sizes=[100.],\n\t\t    clip=True,\n\t\t    flip=True)\n\t\t# print(box.shape)\n\t\t# [6L, 9L, 1L, 4L]\n                # print(var.shape)\n\t\t# [6L, 9L, 1L, 4L]\n\n    '
    helper = LayerHelper('prior_box', **locals())
    dtype = helper.input_dtype()
    check_variable_and_dtype(input, 'input', ['uint8', 'int8', 'float32', 'float64'], 'prior_box')

    def _is_list_or_tuple_(data):
        return (isinstance(data, list) or isinstance(data, tuple))
    if (not _is_list_or_tuple_(min_sizes)):
        min_sizes = [min_sizes]
    if (not _is_list_or_tuple_(aspect_ratios)):
        aspect_ratios = [aspect_ratios]
    if (not (_is_list_or_tuple_(steps) and (len(steps) == 2))):
        raise ValueError('steps should be a list or tuple ', 'with length 2, (step_width, step_height).')
    min_sizes = list(map(float, min_sizes))
    aspect_ratios = list(map(float, aspect_ratios))
    steps = list(map(float, steps))
    attrs = {'min_sizes': min_sizes, 'aspect_ratios': aspect_ratios, 'variances': variance, 'flip': flip, 'clip': clip, 'step_w': steps[0], 'step_h': steps[1], 'offset': offset, 'min_max_aspect_ratios_order': min_max_aspect_ratios_order}
    if ((max_sizes is not None) and (len(max_sizes) > 0) and (max_sizes[0] > 0)):
        if (not _is_list_or_tuple_(max_sizes)):
            max_sizes = [max_sizes]
        attrs['max_sizes'] = max_sizes
    box = helper.create_variable_for_type_inference(dtype)
    var = helper.create_variable_for_type_inference(dtype)
    helper.append_op(type='prior_box', inputs={'Input': input, 'Image': image}, outputs={'Boxes': box, 'Variances': var}, attrs=attrs)
    box.stop_gradient = True
    var.stop_gradient = True
    return (box, var)
:alias_main: paddle.nn.functional.prior_box
    :alias: paddle.nn.functional.prior_box,paddle.nn.functional.vision.prior_box
    :old_api: paddle.fluid.layers.prior_box

This op generates prior boxes for SSD(Single Shot MultiBox Detector) algorithm.
Each position of the input produce N prior boxes, N is determined by
the count of min_sizes, max_sizes and aspect_ratios, The size of the
box is in range(min_size, max_size) interval, which is generated in
sequence according to the aspect_ratios.

Parameters:
   input(Variable): 4-D tensor(NCHW), the data type should be float32 or float64.
   image(Variable): 4-D tensor(NCHW), the input image data of PriorBoxOp,
        the data type should be float32 or float64.
   min_sizes(list|tuple|float): the min sizes of generated prior boxes.
   max_sizes(list|tuple|None): the max sizes of generated prior boxes.
        Default: None.
   aspect_ratios(list|tuple|float): the aspect ratios of generated
        prior boxes. Default: [1.].
   variance(list|tuple): the variances to be encoded in prior boxes.
        Default:[0.1, 0.1, 0.2, 0.2].
   flip(bool): Whether to flip aspect ratios. Default:False.
   clip(bool): Whether to clip out-of-boundary boxes. Default: False.
   step(list|tuple): Prior boxes step across width and height, If
        step[0] equals to 0.0 or step[1] equals to 0.0, the prior boxes step across
        height or weight of the input will be automatically calculated.
        Default: [0., 0.]
   offset(float): Prior boxes center offset. Default: 0.5
   min_max_aspect_ratios_order(bool): If set True, the output prior box is
        in order of [min, max, aspect_ratios], which is consistent with
        Caffe. Please note, this order affects the weights order of
        convolution layer followed by and does not affect the final
        detection results. Default: False.
   name(str, optional): The default value is None.  Normally there is no need for user to set this property.  For more information, please refer to :ref:`api_guide_Name`

Returns:
    Tuple: A tuple with two Variable (boxes, variances)

    boxes(Variable): the output prior boxes of PriorBox.
    4-D tensor, the layout is [H, W, num_priors, 4].
    H is the height of input, W is the width of input,
    num_priors is the total box count of each position of input.

    variances(Variable): the expanded variances of PriorBox.
    4-D tensor, the layput is [H, W, num_priors, 4].
    H is the height of input, W is the width of input
    num_priors is the total box count of each position of input

Examples:
    .. code-block:: python

        #declarative mode
        import paddle.fluid as fluid
        import numpy as np
        input = fluid.data(name="input", shape=[None,3,6,9])
        image = fluid.data(name="image", shape=[None,3,9,12])
        box, var = fluid.layers.prior_box(
             input=input,
             image=image,
             min_sizes=[100.],
             clip=True,
             flip=True)

        place = fluid.CPUPlace()
        exe = fluid.Executor(place)
        exe.run(fluid.default_startup_program())

        # prepare a batch of data
        input_data = np.random.rand(1,3,6,9).astype("float32")
        image_data = np.random.rand(1,3,9,12).astype("float32")

        box_out, var_out = exe.run(fluid.default_main_program(),
            feed={"input":input_data,"image":image_data},
            fetch_list=[box,var],
            return_numpy=True)

        # print(box_out.shape)
        # (6, 9, 1, 4)
        # print(var_out.shape)
        # (6, 9, 1, 4)

        # imperative mode
        import paddle.fluid.dygraph as dg

        with dg.guard(place) as g:
            input = dg.to_variable(input_data)
            image = dg.to_variable(image_data)
            box, var = fluid.layers.prior_box(
                input=input,
                image=image,
                min_sizes=[100.],
                clip=True,
                flip=True)
            # print(box.shape)
            # [6L, 9L, 1L, 4L]
            # print(var.shape)
            # [6L, 9L, 1L, 4L]
def prior_box(input, image, min_sizes, max_sizes=None, aspect_ratios=[1.0], variance=[0.1, 0.1, 0.2, 0.2], flip=False, clip=False, steps=[0.0, 0.0], offset=0.5, name=None, min_max_aspect_ratios_order=False):
    '\n\t:alias_main: paddle.nn.functional.prior_box\n\t:alias: paddle.nn.functional.prior_box,paddle.nn.functional.vision.prior_box\n\t:old_api: paddle.fluid.layers.prior_box\n\n    This op generates prior boxes for SSD(Single Shot MultiBox Detector) algorithm.\n    Each position of the input produce N prior boxes, N is determined by\n    the count of min_sizes, max_sizes and aspect_ratios, The size of the\n    box is in range(min_size, max_size) interval, which is generated in\n    sequence according to the aspect_ratios.\n\n    Parameters:\n       input(Variable): 4-D tensor(NCHW), the data type should be float32 or float64.\n       image(Variable): 4-D tensor(NCHW), the input image data of PriorBoxOp,\n            the data type should be float32 or float64.\n       min_sizes(list|tuple|float): the min sizes of generated prior boxes.\n       max_sizes(list|tuple|None): the max sizes of generated prior boxes.\n            Default: None.\n       aspect_ratios(list|tuple|float): the aspect ratios of generated\n            prior boxes. Default: [1.].\n       variance(list|tuple): the variances to be encoded in prior boxes.\n            Default:[0.1, 0.1, 0.2, 0.2].\n       flip(bool): Whether to flip aspect ratios. Default:False.\n       clip(bool): Whether to clip out-of-boundary boxes. Default: False.\n       step(list|tuple): Prior boxes step across width and height, If\n            step[0] equals to 0.0 or step[1] equals to 0.0, the prior boxes step across\n            height or weight of the input will be automatically calculated.\n            Default: [0., 0.]\n       offset(float): Prior boxes center offset. Default: 0.5\n       min_max_aspect_ratios_order(bool): If set True, the output prior box is\n            in order of [min, max, aspect_ratios], which is consistent with\n            Caffe. Please note, this order affects the weights order of\n            convolution layer followed by and does not affect the final\n            detection results. Default: False.\n       name(str, optional): The default value is None.  Normally there is no need for user to set this property.  For more information, please refer to :ref:`api_guide_Name`\n\n    Returns:\n        Tuple: A tuple with two Variable (boxes, variances)\n\n        boxes(Variable): the output prior boxes of PriorBox.\n\t4-D tensor, the layout is [H, W, num_priors, 4].\n        H is the height of input, W is the width of input,\n        num_priors is the total box count of each position of input.\n\n        variances(Variable): the expanded variances of PriorBox.\n    \t4-D tensor, the layput is [H, W, num_priors, 4].\n        H is the height of input, W is the width of input\n        num_priors is the total box count of each position of input\n\n    Examples:\n        .. code-block:: python\n\n\t    #declarative mode\n\t    import paddle.fluid as fluid\n\t    import numpy as np\n\t    input = fluid.data(name="input", shape=[None,3,6,9])\n\t    image = fluid.data(name="image", shape=[None,3,9,12])\n\t    box, var = fluid.layers.prior_box(\n                 input=input,\n                 image=image,\n\t\t min_sizes=[100.],\n                 clip=True,\n                 flip=True)\n\n\t    place = fluid.CPUPlace()\n\t    exe = fluid.Executor(place)\n\t    exe.run(fluid.default_startup_program())\n \n\t    # prepare a batch of data\n\t    input_data = np.random.rand(1,3,6,9).astype("float32")\n\t    image_data = np.random.rand(1,3,9,12).astype("float32")\n \n\t    box_out, var_out = exe.run(fluid.default_main_program(),\n                feed={"input":input_data,"image":image_data},\n                fetch_list=[box,var],\n                return_numpy=True)\n \n\t    # print(box_out.shape)\n\t    # (6, 9, 1, 4)\n\t    # print(var_out.shape)\n\t    # (6, 9, 1, 4)\n\n\t    # imperative mode\n\t    import paddle.fluid.dygraph as dg\n\n\t    with dg.guard(place) as g:\n    \t\tinput = dg.to_variable(input_data)\n    \t\timage = dg.to_variable(image_data)\n    \t\tbox, var = fluid.layers.prior_box(\n\t\t    input=input,\n\t\t    image=image,\n\t\t    min_sizes=[100.],\n\t\t    clip=True,\n\t\t    flip=True)\n\t\t# print(box.shape)\n\t\t# [6L, 9L, 1L, 4L]\n                # print(var.shape)\n\t\t# [6L, 9L, 1L, 4L]\n\n    '
    helper = LayerHelper('prior_box', **locals())
    dtype = helper.input_dtype()
    check_variable_and_dtype(input, 'input', ['uint8', 'int8', 'float32', 'float64'], 'prior_box')

    def _is_list_or_tuple_(data):
        return (isinstance(data, list) or isinstance(data, tuple))
    if (not _is_list_or_tuple_(min_sizes)):
        min_sizes = [min_sizes]
    if (not _is_list_or_tuple_(aspect_ratios)):
        aspect_ratios = [aspect_ratios]
    if (not (_is_list_or_tuple_(steps) and (len(steps) == 2))):
        raise ValueError('steps should be a list or tuple ', 'with length 2, (step_width, step_height).')
    min_sizes = list(map(float, min_sizes))
    aspect_ratios = list(map(float, aspect_ratios))
    steps = list(map(float, steps))
    attrs = {'min_sizes': min_sizes, 'aspect_ratios': aspect_ratios, 'variances': variance, 'flip': flip, 'clip': clip, 'step_w': steps[0], 'step_h': steps[1], 'offset': offset, 'min_max_aspect_ratios_order': min_max_aspect_ratios_order}
    if ((max_sizes is not None) and (len(max_sizes) > 0) and (max_sizes[0] > 0)):
        if (not _is_list_or_tuple_(max_sizes)):
            max_sizes = [max_sizes]
        attrs['max_sizes'] = max_sizes
    box = helper.create_variable_for_type_inference(dtype)
    var = helper.create_variable_for_type_inference(dtype)
    helper.append_op(type='prior_box', inputs={'Input': input, 'Image': image}, outputs={'Boxes': box, 'Variances': var}, attrs=attrs)
    box.stop_gradient = True
    var.stop_gradient = True
    return (box, var)