def gen_function_call(func_attrs, backend_spec, indent="  "):
    """the function for generating a function call for nms op"""

    assert len(func_attrs["outputs"]) == 4
    assert len(func_attrs["inputs"]) == 2

    num_detections = func_attrs["outputs"][0]._attrs["name"]
    detection_boxes = func_attrs["outputs"][1]._attrs["name"]
    detection_scores = func_attrs["outputs"][2]._attrs["name"]
    detection_classes = func_attrs["outputs"][3]._attrs["name"]
    (input_name, score_name) = (
        input_tensor._attrs["name"] for input_tensor in func_attrs["inputs"]
    )

    x = func_attrs["inputs"][0]
    xshape = x._attrs["shape"]

    return FUNC_CALL_TEMPLATE.render(
        func_name=func_attrs["name"],
        num_detections=num_detections,
        detection_boxes=detection_boxes,
        detection_scores=detection_scores,
        detection_classe=detection_classes,
        proposals=input_name,
        fgScores=score_name,
        p_batch="&" + xshape[0]._attrs["name"],
        num_rois="&" + xshape[1]._attrs["name"],
        num_classes="&" + xshape[2]._attrs["name"],
        preNmsTop=func_attrs["preNmsTop"],
        nmsMaxOut=func_attrs["nmsMaxOut"],
        iouThreshold=func_attrs["iouThreshold"],
        minBoxSize=func_attrs["minBoxSize"],
        indent=indent,
    )
the function for generating a function call for nms op
python/aitemplate/backend/common/vision_ops/efficient_nms_common.py