def bipartite_match(dist_matrix, match_type=None, dist_threshold=None, name=None):
    "\n\t:alias_main: paddle.nn.functional.bipartite_match\n\t:alias: paddle.nn.functional.bipartite_match,paddle.nn.functional.vision.bipartite_match\n\t:old_api: paddle.fluid.layers.bipartite_match\n\n    This operator implements a greedy bipartite matching algorithm, which is\n    used to obtain the matching with the maximum distance based on the input\n    distance matrix. For input 2D matrix, the bipartite matching algorithm can\n    find the matched column for each row (matched means the largest distance),\n    also can find the matched row for each column. And this operator only\n    calculate matched indices from column to row. For each instance,\n    the number of matched indices is the column number of the input distance\n    matrix. **The OP only supports CPU**.\n\n    There are two outputs, matched indices and distance.\n    A simple description, this algorithm matched the best (maximum distance)\n    row entity to the column entity and the matched indices are not duplicated\n    in each row of ColToRowMatchIndices. If the column entity is not matched\n    any row entity, set -1 in ColToRowMatchIndices.\n\n    NOTE: the input DistMat can be LoDTensor (with LoD) or Tensor.\n    If LoDTensor with LoD, the height of ColToRowMatchIndices is batch size.\n    If Tensor, the height of ColToRowMatchIndices is 1.\n\n    NOTE: This API is a very low level API. It is used by :code:`ssd_loss`\n    layer. Please consider to use :code:`ssd_loss` instead.\n\n    Args:\n        dist_matrix(Variable): This input is a 2-D LoDTensor with shape\n            [K, M]. The data type is float32 or float64. It is pair-wise \n            distance matrix between the entities represented by each row and \n            each column. For example, assumed one entity is A with shape [K], \n            another entity is B with shape [M]. The dist_matrix[i][j] is the \n            distance between A[i] and B[j]. The bigger the distance is, the \n            better matching the pairs are. NOTE: This tensor can contain LoD \n            information to represent a batch of inputs. One instance of this \n            batch can contain different numbers of entities.\n        match_type(str, optional): The type of matching method, should be\n           'bipartite' or 'per_prediction'. None ('bipartite') by default.\n        dist_threshold(float32, optional): If `match_type` is 'per_prediction',\n            this threshold is to determine the extra matching bboxes based\n            on the maximum distance, 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 \n            None by default.\n \n    Returns:\n        Tuple:\n\n        matched_indices(Variable): A 2-D Tensor with shape [N, M]. The data\n        type is int32. N is the batch size. If match_indices[i][j] is -1, it\n        means B[j] does not match any entity in i-th instance.\n        Otherwise, it means B[j] is matched to row\n        match_indices[i][j] in i-th instance. The row number of\n        i-th instance is saved in match_indices[i][j].\n\n        matched_distance(Variable): A 2-D Tensor with shape [N, M]. The data\n        type is float32. N is batch size. If match_indices[i][j] is -1,\n        match_distance[i][j] is also -1.0. Otherwise, assumed\n        match_distance[i][j] = d, and the row offsets of each instance\n        are called LoD. Then match_distance[i][j] =\n        dist_matrix[d+LoD[i]][j].\n\n    Examples:\n\n        >>> import paddle.fluid as fluid\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        >>> matched_indices, matched_dist = fluid.layers.bipartite_match(iou)\n    "
    helper = LayerHelper('bipartite_match', **locals())
    match_indices = helper.create_variable_for_type_inference(dtype='int32')
    match_distance = helper.create_variable_for_type_inference(dtype=dist_matrix.dtype)
    helper.append_op(type='bipartite_match', inputs={'DistMat': dist_matrix}, attrs={'match_type': match_type, 'dist_threshold': dist_threshold}, outputs={'ColToRowMatchIndices': match_indices, 'ColToRowMatchDist': match_distance})
    return (match_indices, match_distance)
:alias_main: paddle.nn.functional.bipartite_match
    :alias: paddle.nn.functional.bipartite_match,paddle.nn.functional.vision.bipartite_match
    :old_api: paddle.fluid.layers.bipartite_match

This operator implements a greedy bipartite matching algorithm, which is
used to obtain the matching with the maximum distance based on the input
distance matrix. For input 2D matrix, the bipartite matching algorithm can
find the matched column for each row (matched means the largest distance),
also can find the matched row for each column. And this operator only
calculate matched indices from column to row. For each instance,
the number of matched indices is the column number of the input distance
matrix. **The OP only supports CPU**.

There are two outputs, matched indices and distance.
A simple description, this algorithm matched the best (maximum distance)
row entity to the column entity and the matched indices are not duplicated
in each row of ColToRowMatchIndices. If the column entity is not matched
any row entity, set -1 in ColToRowMatchIndices.

NOTE: the input DistMat can be LoDTensor (with LoD) or Tensor.
If LoDTensor with LoD, the height of ColToRowMatchIndices is batch size.
If Tensor, the height of ColToRowMatchIndices is 1.

NOTE: This API is a very low level API. It is used by :code:`ssd_loss`
layer. Please consider to use :code:`ssd_loss` instead.

Args:
    dist_matrix(Variable): This input is a 2-D LoDTensor with shape
        [K, M]. The data type is float32 or float64. It is pair-wise 
        distance matrix between the entities represented by each row and 
        each column. For example, assumed one entity is A with shape [K], 
        another entity is B with shape [M]. The dist_matrix[i][j] is the 
        distance between A[i] and B[j]. The bigger the distance is, the 
        better matching the pairs are. NOTE: This tensor can contain LoD 
        information to represent a batch of inputs. One instance of this 
        batch can contain different numbers of entities.
    match_type(str, optional): The type of matching method, should be
       'bipartite' or 'per_prediction'. None ('bipartite') by default.
    dist_threshold(float32, optional): If `match_type` is 'per_prediction',
        this threshold is to determine the extra matching bboxes based
        on the maximum distance, 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:

    matched_indices(Variable): A 2-D Tensor with shape [N, M]. The data
    type is int32. N is the batch size. If match_indices[i][j] is -1, it
    means B[j] does not match any entity in i-th instance.
    Otherwise, it means B[j] is matched to row
    match_indices[i][j] in i-th instance. The row number of
    i-th instance is saved in match_indices[i][j].

    matched_distance(Variable): A 2-D Tensor with shape [N, M]. The data
    type is float32. N is batch size. If match_indices[i][j] is -1,
    match_distance[i][j] is also -1.0. Otherwise, assumed
    match_distance[i][j] = d, and the row offsets of each instance
    are called LoD. Then match_distance[i][j] =
    dist_matrix[d+LoD[i]][j].

Examples:

    >>> import paddle.fluid as fluid
    >>> 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)
    >>> matched_indices, matched_dist = fluid.layers.bipartite_match(iou)
def bipartite_match(dist_matrix, match_type=None, dist_threshold=None, name=None):
    "\n\t:alias_main: paddle.nn.functional.bipartite_match\n\t:alias: paddle.nn.functional.bipartite_match,paddle.nn.functional.vision.bipartite_match\n\t:old_api: paddle.fluid.layers.bipartite_match\n\n    This operator implements a greedy bipartite matching algorithm, which is\n    used to obtain the matching with the maximum distance based on the input\n    distance matrix. For input 2D matrix, the bipartite matching algorithm can\n    find the matched column for each row (matched means the largest distance),\n    also can find the matched row for each column. And this operator only\n    calculate matched indices from column to row. For each instance,\n    the number of matched indices is the column number of the input distance\n    matrix. **The OP only supports CPU**.\n\n    There are two outputs, matched indices and distance.\n    A simple description, this algorithm matched the best (maximum distance)\n    row entity to the column entity and the matched indices are not duplicated\n    in each row of ColToRowMatchIndices. If the column entity is not matched\n    any row entity, set -1 in ColToRowMatchIndices.\n\n    NOTE: the input DistMat can be LoDTensor (with LoD) or Tensor.\n    If LoDTensor with LoD, the height of ColToRowMatchIndices is batch size.\n    If Tensor, the height of ColToRowMatchIndices is 1.\n\n    NOTE: This API is a very low level API. It is used by :code:`ssd_loss`\n    layer. Please consider to use :code:`ssd_loss` instead.\n\n    Args:\n        dist_matrix(Variable): This input is a 2-D LoDTensor with shape\n            [K, M]. The data type is float32 or float64. It is pair-wise \n            distance matrix between the entities represented by each row and \n            each column. For example, assumed one entity is A with shape [K], \n            another entity is B with shape [M]. The dist_matrix[i][j] is the \n            distance between A[i] and B[j]. The bigger the distance is, the \n            better matching the pairs are. NOTE: This tensor can contain LoD \n            information to represent a batch of inputs. One instance of this \n            batch can contain different numbers of entities.\n        match_type(str, optional): The type of matching method, should be\n           'bipartite' or 'per_prediction'. None ('bipartite') by default.\n        dist_threshold(float32, optional): If `match_type` is 'per_prediction',\n            this threshold is to determine the extra matching bboxes based\n            on the maximum distance, 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 \n            None by default.\n \n    Returns:\n        Tuple:\n\n        matched_indices(Variable): A 2-D Tensor with shape [N, M]. The data\n        type is int32. N is the batch size. If match_indices[i][j] is -1, it\n        means B[j] does not match any entity in i-th instance.\n        Otherwise, it means B[j] is matched to row\n        match_indices[i][j] in i-th instance. The row number of\n        i-th instance is saved in match_indices[i][j].\n\n        matched_distance(Variable): A 2-D Tensor with shape [N, M]. The data\n        type is float32. N is batch size. If match_indices[i][j] is -1,\n        match_distance[i][j] is also -1.0. Otherwise, assumed\n        match_distance[i][j] = d, and the row offsets of each instance\n        are called LoD. Then match_distance[i][j] =\n        dist_matrix[d+LoD[i]][j].\n\n    Examples:\n\n        >>> import paddle.fluid as fluid\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        >>> matched_indices, matched_dist = fluid.layers.bipartite_match(iou)\n    "
    helper = LayerHelper('bipartite_match', **locals())
    match_indices = helper.create_variable_for_type_inference(dtype='int32')
    match_distance = helper.create_variable_for_type_inference(dtype=dist_matrix.dtype)
    helper.append_op(type='bipartite_match', inputs={'DistMat': dist_matrix}, attrs={'match_type': match_type, 'dist_threshold': dist_threshold}, outputs={'ColToRowMatchIndices': match_indices, 'ColToRowMatchDist': match_distance})
    return (match_indices, match_distance)