class_docstr: Reuses internals of a SpectrogramGenerator to resynthesize dataset using ground truth features.
  Default setup is FastPitch with learned alignment.
  If your use case requires different setup, you can either contribute to this script or subclass this class.
class_docstr_tok: ["Reuses","internals","of","a","SpectrogramGenerator","to","resynthesize","dataset","using","ground","truth","features",".","Default","setup","is","FastPitch","with","learned","alignment",".","If","your","use","case","requires","different","setup",",","you","can","either","contribute","to","this","script","or","subclass","this","class","."]
docstr: Returns a generator of resynthesized batches.
  Each returned batch is a dict containing main data, sup data, and model output
docstr_tok: ["Returns","a","generator","of","resynthesized","batches",".","Each","returned","batch","is","a","dict","containing","main","data",",","sup","data",",","and","model","output"]
code: def resynthesized_batches(self) -> Iterator[Dict[str, Any]]:
      """
      Returns a generator of resynthesized batches.
      Each returned batch is a dict containing main data, sup data, and model output
      """
      self.model.setup_training_data(self.model._cfg["train_ds"])
  
      for batch_tuple in iter(self.model._train_dl):
          batch = process_batch(
              batch_tuple,
              sup_data_types_set=self.model._train_dl.dataset.sup_data_types,
          )
          yield self.resynthesize_batch(batch)
  
imports: import argparse
  import itertools
  from dataclasses import dataclass
  from pathlib import Path
  from typing import Any, Dict, Iterable, Iterator, List
  import numpy
  import torch
  from omegaconf import DictConfig, OmegaConf
  from tqdm import tqdm
  from nemo.collections.asr.parts.utils.manifest_utils import read_manifest, write_manifest
  from nemo.collections.tts.models import FastPitchModel
  from nemo.collections.tts.models.base import SpectrogramGenerator
  from nemo.collections.tts.parts.utils.helpers import process_batch, to_device_recursive
label_desc: Use image node_id 2 for calling the TTSDatasetResynthesizer obj's underlying member method code with example usage: obj.resynthesized_batches() without return types