def _check_permute(op: Operator, dims: Sequence[int]) -> bool:
    """Check permute dims match input dims

    Args:
        op (Operator): permute op
        dims (Sequence): permute dims

    Returns:
        bool: True if match
    """
    permute_dims = op._attrs["dims"]
    if len(dims) != len(permute_dims):
        return False
    for d0, d1 in zip(dims, permute_dims):
        if d0 != d1:
            return False
    return True
Check permute dims match input dims

Args:
op (Operator): permute op
dims (Sequence): permute dims

Returns:
bool: True if match
python/aitemplate/compiler/transform/fuse_mm_reshape_permute.py