from typing import Dict


def sort_stats_by_kind(stats: Dict) -> Dict:
    """
    Generate dict-of-dicts for statistics.

    Returns
    -------
    Dict[str, Dict]
        A dict-of-dicts, where the key is the kind of the statistics in each dict.
    """
    failure = {}
    report = {}
    success = {}
    for k, v in stats.items():
        if v.kind == 'failure':
            failure[k] = v
        elif v.kind == 'success':
            success[k] = v
        else:
            report[k] = v
    return {'failure': failure, 'report': report, 'success': success}