def METHOD_NAME(
        dataset: TextToSpeechDataset, sample, hypos, resample_fn, dump_target
):
    def to_np(x):
        return None if x is None else x.detach().cpu().numpy()
    sample_ids = [dataset.ids[i] for i in sample["id"].tolist()]
    texts = sample["src_texts"]
    attns = [to_np(hypo["attn"]) for hypo in hypos]
    eos_probs = [to_np(hypo.get("eos_prob", None)) for hypo in hypos]
    feat_preds = [to_np(hypo["feature"]) for hypo in hypos]
    wave_preds = [to_np(resample_fn(h["waveform"])) for h in hypos]
    if dump_target:
        feat_targs = [to_np(hypo["targ_feature"]) for hypo in hypos]
        wave_targs = [to_np(resample_fn(h["targ_waveform"])) for h in hypos]
    else:
        feat_targs = [None for _ in hypos]
        wave_targs = [None for _ in hypos]
    return zip(sample_ids, texts, attns, eos_probs, feat_preds, wave_preds,
               feat_targs, wave_targs)