def gen_function(func_attrs: Dict[str, Any], header_files, backend_spec) -> str:
    """the function for generating nms kernel"""
    elem_input_type = backend_spec.dtype_to_backend_type(
        func_attrs["inputs"][0]._attrs["dtype"]
    )
    return FUNC_TEMPLATE.render(
        header_files=header_files,
        kernel=kernel.render(
            prefix=backend_spec.prefix,
            cub=backend_spec.cub,
            elem_input_type=elem_input_type,
        ),
        func_signature=FUNC_SIGNATURE.render(
            func_name=func_attrs["name"], prefix=backend_spec.prefix
        ),
    )
the function for generating nms kernel
python/aitemplate/backend/common/vision_ops/efficient_nms_common.py