def METHOD_NAME(
    self,
    all_in_memory=False,
    ordered_prefetch=False,
    has_utt2num_frames=False,
):
    if not all_in_memory:
        src_dataset = AudioFeatCachedDataset(
            utt_ids=self.feats_utt_ids,
            rxfiles=self.rxfiles,
            utt2num_frames=self.utt2num_frames if has_utt2num_frames else None,
            ordered_prefetch=ordered_prefetch,
            cache_size=self.cache_size,
        )
    else:
        src_dataset = AudioFeatInMemoryDataset(
            utt_ids=self.feats_utt_ids,
            rxfiles=self.rxfiles,
            utt2num_frames=self.utt2num_frames if has_utt2num_frames else None,
        )
    tgt_dataset = AsrTextDataset(
        utt_ids=self.text_utt_ids,
        texts=self.texts,
        dictionary=self.dictionary,
    )
    dataset = AsrDataset(
        src_dataset,
        src_dataset.sizes,
        tgt_dataset,
        tgt_dataset.sizes,
        self.dictionary,
        left_pad_source=False,
        left_pad_target=False,
    )
    # assume one is a subset of the other
    expected_dataset_size = min(self.num_audios, self.num_transripts)
    self.assertEqual(len(dataset.src), expected_dataset_size)
    self.assertEqual(len(dataset.tgt), expected_dataset_size)
    indices = list(range(expected_dataset_size))
    batch_sampler = []
    for i in range(0, expected_dataset_size, self.batch_size):
        batch_sampler.append(indices[i : i + self.batch_size])
    if not all_in_memory:
        dataset.prefetch(indices)
    dataloader = torch.utils.data.DataLoader(
        dataset,
        collate_fn=dataset.collater,
        batch_sampler=batch_sampler,
    )
    for i, batch in enumerate(iter(dataloader)):
        bsz = batch["nsentences"]
        self.assertEqual(bsz, len(batch_sampler[i]))
        src_frames = batch["net_input"]["src_tokens"]
        src_lengths = batch["net_input"]["src_lengths"]
        tgt_tokens = self.dictionary.string(
            batch["target"], extra_symbols_to_ignore={self.dictionary.pad()}
        ).split("\n")
        tgt_tokens = [line.split(" ") for line in tgt_tokens]
        self.assertEqual(bsz, src_frames.size(0))
        self.assertEqual(bsz, src_lengths.numel())
        self.assertEqual(bsz, len(tgt_tokens))
        for j, utt_id in enumerate(batch["utt_id"]):
            self.assertTensorEqual(
                torch.from_numpy(self.expected_feats[utt_id]).float(),
                src_frames[j, : src_lengths[j], :],
            )
            self.assertEqual(
                self.expected_texts[utt_id],
                tgt_tokens[j],
            )