def fuse_mm_elementwise(
    sorted_graph: List[Tensor], workdir: str = None
) -> List[Tensor]:
    """Fuse GEMMs with elementwise operations.

    Parameters
    ----------
    sorted_graph : List[Tensor]
        Input graph
    workdir : str, optional
        working dir, by default None

    Returns
    -------
    List[Tensor]
        Fused graph
    """
    funcs = [
        _fuse_bmm_mul_or_div_alpha,
        _transform_gemm_bias,
        _transform_mm_elementwise,
        _fuse_gemm_rcr_bias_swish,
    ]
    for func in funcs:
        sorted_graph = func(sorted_graph)
    return sorted_graph
Fuse GEMMs with elementwise operations.

    Parameters
    ----------
    sorted_graph : List[Tensor]
        Input graph
    workdir : str, optional
        working dir, by default None

    Returns
    -------
    List[Tensor]
        Fused graph
    
python/aitemplate/compiler/transform/fuse_mm_elementwise.py