def fuse_mm_reshape_permute(
    sorted_graph: List[Tensor], workdir: str = None
) -> List[Tensor]:
    """Fuse GEMM/BMM + reshape + permute into a single op

    Args:
        sorted_graph (List[Tensor]): input graph
        workdir (str, optional): current workdir for dumping debug info. Defaults to None.

    Returns:
        List[Tensor]: optimized graph
    """

    funcs = [
        _fuse_gemm_reshape_permute0213,
    ]
    for func in funcs:
        sorted_graph = func(sorted_graph)
    return sorted_graph
Fuse GEMM/BMM + reshape + permute into a single op

    Args:
        sorted_graph (List[Tensor]): input graph
        workdir (str, optional): current workdir for dumping debug info. Defaults to None.

    Returns:
        List[Tensor]: optimized graph
    
python/aitemplate/compiler/transform/fuse_mm_reshape_permute.py