def METHOD_NAME(cls, logging_outputs: List[Dict[str, Any]]) -> None:
    ns = [log.get("sample_size", 0) for log in logging_outputs]
    ntot = sum(ns)
    ws = [n / (ntot + 1e-8) for n in ns]
    for key in [
        "loss", "l1_loss", "dur_loss", "pitch_loss", "energy_loss",
        "ctc_loss"
    ]:
        vals = [log.get(key, 0) for log in logging_outputs]
        val = sum(val * w for val, w in zip(vals, ws))
        metrics.log_scalar(key, val, ntot, round=3)
    metrics.log_scalar("sample_size", ntot, len(logging_outputs))
    # inference metrics
    if "targ_frames" not in logging_outputs[0]:
        return
    n = sum(log.get("targ_frames", 0) for log in logging_outputs)
    for key, new_key in [
            ("mcd_loss", "mcd_loss"),
            ("pred_frames", "pred_ratio"),
            ("nins", "ins_rate"),
            ("ndel", "del_rate"),
    ]:
        val = sum(log.get(key, 0) for log in logging_outputs)
        metrics.log_scalar(new_key, val / n, n, round=3)