@templatedoc()
def iou_similarity(x, y, box_normalized=True, name=None):
    "\n\t:alias_main: paddle.nn.functional.iou_similarity\n\t:alias: paddle.nn.functional.iou_similarity,paddle.nn.functional.loss.iou_similarity\n\t:old_api: paddle.fluid.layers.iou_similarity\n\n    ${comment}\n\n    Args:\n        x (Variable): ${x_comment}.The data type is float32 or float64.\n        y (Variable): ${y_comment}.The data type is float32 or float64.\n        box_normalized(bool): Whether treat the priorbox as a normalized box.\n            Set true by default.\n    Returns:\n        Variable: ${out_comment}.The data type is same with x.\n\n    Examples:\n        .. code-block:: python\n\n            import numpy as np\n            import paddle.fluid as fluid\n\n            use_gpu = False\n            place = fluid.CUDAPlace(0) if use_gpu else fluid.CPUPlace()\n            exe = fluid.Executor(place)\n\n            x = fluid.data(name='x', shape=[None, 4], dtype='float32')\n            y = fluid.data(name='y', shape=[None, 4], dtype='float32')\n            iou = fluid.layers.iou_similarity(x=x, y=y)\n\n            exe.run(fluid.default_startup_program())\n            test_program = fluid.default_main_program().clone(for_test=True)\n\n            [out_iou] = exe.run(test_program,\n                    fetch_list=iou,\n                    feed={'x': np.array([[0.5, 0.5, 2.0, 2.0],\n                                         [0., 0., 1.0, 1.0]]).astype('float32'),\n                          'y': np.array([[1.0, 1.0, 2.5, 2.5]]).astype('float32')})\n            # out_iou is [[0.2857143],\n            #             [0.       ]] with shape: [2, 1]\n    "
    helper = LayerHelper('iou_similarity', **locals())
    out = helper.create_variable_for_type_inference(dtype=x.dtype)
    helper.append_op(type='iou_similarity', inputs={'X': x, 'Y': y}, attrs={'box_normalized': box_normalized}, outputs={'Out': out})
    return out
:alias_main: paddle.nn.functional.iou_similarity
    :alias: paddle.nn.functional.iou_similarity,paddle.nn.functional.loss.iou_similarity
    :old_api: paddle.fluid.layers.iou_similarity

${comment}

Args:
    x (Variable): ${x_comment}.The data type is float32 or float64.
    y (Variable): ${y_comment}.The data type is float32 or float64.
    box_normalized(bool): Whether treat the priorbox as a normalized box.
        Set true by default.
Returns:
    Variable: ${out_comment}.The data type is same with x.

Examples:
    .. code-block:: python

        import numpy as np
        import paddle.fluid as fluid

        use_gpu = False
        place = fluid.CUDAPlace(0) if use_gpu else fluid.CPUPlace()
        exe = fluid.Executor(place)

        x = fluid.data(name='x', shape=[None, 4], dtype='float32')
        y = fluid.data(name='y', shape=[None, 4], dtype='float32')
        iou = fluid.layers.iou_similarity(x=x, y=y)

        exe.run(fluid.default_startup_program())
        test_program = fluid.default_main_program().clone(for_test=True)

        [out_iou] = exe.run(test_program,
                fetch_list=iou,
                feed={'x': np.array([[0.5, 0.5, 2.0, 2.0],
                                     [0., 0., 1.0, 1.0]]).astype('float32'),
                      'y': np.array([[1.0, 1.0, 2.5, 2.5]]).astype('float32')})
        # out_iou is [[0.2857143],
        #             [0.       ]] with shape: [2, 1]
@templatedoc()
def iou_similarity(x, y, box_normalized=True, name=None):
    "\n\t:alias_main: paddle.nn.functional.iou_similarity\n\t:alias: paddle.nn.functional.iou_similarity,paddle.nn.functional.loss.iou_similarity\n\t:old_api: paddle.fluid.layers.iou_similarity\n\n    ${comment}\n\n    Args:\n        x (Variable): ${x_comment}.The data type is float32 or float64.\n        y (Variable): ${y_comment}.The data type is float32 or float64.\n        box_normalized(bool): Whether treat the priorbox as a normalized box.\n            Set true by default.\n    Returns:\n        Variable: ${out_comment}.The data type is same with x.\n\n    Examples:\n        .. code-block:: python\n\n            import numpy as np\n            import paddle.fluid as fluid\n\n            use_gpu = False\n            place = fluid.CUDAPlace(0) if use_gpu else fluid.CPUPlace()\n            exe = fluid.Executor(place)\n\n            x = fluid.data(name='x', shape=[None, 4], dtype='float32')\n            y = fluid.data(name='y', shape=[None, 4], dtype='float32')\n            iou = fluid.layers.iou_similarity(x=x, y=y)\n\n            exe.run(fluid.default_startup_program())\n            test_program = fluid.default_main_program().clone(for_test=True)\n\n            [out_iou] = exe.run(test_program,\n                    fetch_list=iou,\n                    feed={'x': np.array([[0.5, 0.5, 2.0, 2.0],\n                                         [0., 0., 1.0, 1.0]]).astype('float32'),\n                          'y': np.array([[1.0, 1.0, 2.5, 2.5]]).astype('float32')})\n            # out_iou is [[0.2857143],\n            #             [0.       ]] with shape: [2, 1]\n    "
    helper = LayerHelper('iou_similarity', **locals())
    out = helper.create_variable_for_type_inference(dtype=x.dtype)
    helper.append_op(type='iou_similarity', inputs={'X': x, 'Y': y}, attrs={'box_normalized': box_normalized}, outputs={'Out': out})
    return out