def gen_function(
    func_attrs: Dict[str, Any],
    header_files: str,
    backend_spec,
) -> str:
    """
    Parameters
    ----------
    func_attrs : dict
        Attributes from Operator
    header_files : str
        header files included in the function
    backend_spec : class
        specifies the backend configs

    Returns
    -------
    str
        Source code for function generated.
    """
    func_name = func_attrs["name"]
    x = func_attrs["inputs"][0]
    xdtype = x._attrs["dtype"]
    exec_paths = EXEC_TEMPLATE.render()
    return SRC_TEMPLATE.render(
        function_name=func_name,
        header_files=header_files,
        exec_paths=exec_paths,
        prefix=backend_spec.prefix,
        lib_dtype=backend_spec.dtype_to_lib_type(xdtype),
    )
Parameters
----------
func_attrs : dict
Attributes from Operator
header_files : str
header files included in the function
backend_spec : class
specifies the backend configs

Returns
-------
str
Source code for function generated.
python/aitemplate/backend/common/tensor/permute210_common.py